Fix the "Erroneous data format for unserializing" error message
This commit is contained in:
parent
5d1275e938
commit
93c276d059
@ -908,8 +908,13 @@ class ClassMetadataInfo implements ClassMetadata
|
||||
public function newInstance()
|
||||
{
|
||||
if ($this->_prototype === null) {
|
||||
if (version_compare(PHP_VERSION, '5.4') >= 0) {
|
||||
$rc = new \ReflectionClass($this->name);
|
||||
$this->_prototype = $rc->newInstanceWithoutConstructor();
|
||||
} else {
|
||||
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
|
||||
}
|
||||
}
|
||||
|
||||
return clone $this->_prototype;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user