Run version_compare only once for wp_clone(). Props sambauers. fixes #8844 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@10350 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2df4ac7356
commit
09c323f120
|
@ -2927,7 +2927,11 @@ function wp_suspend_cache_invalidation($suspend = true) {
|
|||
* @return object The cloned object
|
||||
*/
|
||||
function wp_clone( $object ) {
|
||||
return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
|
||||
static $can_clone;
|
||||
if ( !isset( $can_clone ) ) {
|
||||
$can_clone = version_compare( phpversion(), '5.0', '>=' );
|
||||
}
|
||||
return $can_clone ? clone $object : $object;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue