Skip to content

Commit

Permalink
[DDC-3120] Fix bug with unserialize bc break in PHP 5.4.29 and PHP 5.…
Browse files Browse the repository at this point in the history
…5.13
  • Loading branch information
beberlei committed Jun 3, 2014
1 parent 9817303 commit d932eb0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,11 @@ public function __sleep()
public function newInstance()
{
if ($this->_prototype === null) {
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
if (PHP_VERSION_ID === 50428 || PHP_VERSION_ID === 50513) {
$this->_prototype = $this->reflClass->newInstanceWithoutConstructor();
} else {
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
}
}

return clone $this->_prototype;
Expand Down

0 comments on commit d932eb0

Please sign in to comment.