Make WordPress Core

Changeset 10351


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7/wp-includes/functions.php

    r10218 r10351  
    29062906 * @return object The cloned object
    29072907 */
    2908 function wp_clone($object) {
    2909     return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
     2908function wp_clone( $object ) {
     2909    static $can_clone;
     2910    if ( !isset( $can_clone ) ) {
     2911        $can_clone = version_compare( phpversion(), '5.0', '>=' );
     2912    }
     2913    return $can_clone ? clone $object : $object;
    29102914}
    29112915
Note: See TracChangeset for help on using the changeset viewer.