1
0
mirror of synced 2025-01-09 02:27:10 +03:00

Using PHP_VERSION_ID instead of version_compare to see if we're using PHP 5.4+

This commit is contained in:
Marco Pivetta 2014-05-31 13:37:39 +02:00
parent a851dd68fb
commit 72750b05e6

View File

@ -908,8 +908,8 @@ class ClassMetadataInfo implements ClassMetadata
public function newInstance()
{
if ($this->_prototype === null) {
if (version_compare(PHP_VERSION, '5.4') >= 0) {
$rc = new \ReflectionClass($this->name);
if (PHP_VERSION_ID >= 50400) {
$rc = new \ReflectionClass($this->name);
$this->_prototype = $rc->newInstanceWithoutConstructor();
} else {
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));