Make WordPress Core

Changeset 10350


Ignore:
Timestamp:
01/13/2009 06:31:58 AM (16 years ago)
Author:
ryan
Message:

Run version_compare only once for wp_clone(). Props sambauers. fixes #8844 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r10322 r10350  
    29272927 * @return object The cloned object
    29282928 */
    2929 function wp_clone($object) {
    2930     return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
     2929function wp_clone( $object ) {
     2930    static $can_clone;
     2931    if ( !isset( $can_clone ) ) {
     2932        $can_clone = version_compare( phpversion(), '5.0', '>=' );
     2933    }
     2934    return $can_clone ? clone $object : $object;
    29312935}
    29322936
Note: See TracChangeset for help on using the changeset viewer.