Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5d1275e + 93c276d commit a851dd6Copy full SHA for a851dd6
1 file changed
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -908,7 +908,12 @@ public function __sleep()
908
public function newInstance()
909
{
910
if ($this->_prototype === null) {
911
- $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
+ if (version_compare(PHP_VERSION, '5.4') >= 0) {
912
+ $rc = new \ReflectionClass($this->name);
913
+ $this->_prototype = $rc->newInstanceWithoutConstructor();
914
+ } else {
915
+ $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
916
+ }
917
}
918
919
return clone $this->_prototype;
0 commit comments