1
0
mirror of synced 2025-02-02 13:31:45 +03:00

DDC-3120 - Using ReflectionClass#newInstanceWithoutConstructor() also with PHP 5.6+

This commit is contained in:
Marco Pivetta 2014-10-06 14:26:00 +02:00
parent 8fc1c34b29
commit a69584a841

View File

@ -866,7 +866,7 @@ class ClassMetadataInfo implements ClassMetadata
public function newInstance()
{
if ($this->_prototype === null) {
if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513) {
if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513 || PHP_VERSION_ID >= 50600) {
$this->_prototype = $this->reflClass->newInstanceWithoutConstructor();
} else {
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));