Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  - Fixed bug #62672 (Error on serialize of ArrayObject) patch by: lior dot k at zend dot com
  - BFN
This commit is contained in:
Felipe Pena 2013-06-25 21:18:34 -03:00
commit f5bf90ef34
2 changed files with 32 additions and 1 deletions

View File

@ -1766,7 +1766,7 @@ SPL_METHOD(Array, unserialize)
++p;
if (*p!='m') {
if (*p!='a' && *p!='O' && *p!='C') {
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
goto outexcept;
}
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;

View File

@ -0,0 +1,31 @@
--TEST--
Bug #62672 (Error on serialize of ArrayObject)
--FILE--
<?php
class ObjA
{
private $_varA;
public function __construct(Iterator $source)
{
$this->_varA = $source;
}
}
class ObjB extends ObjA
{
private $_varB;
public function __construct(ArrayObject $keys)
{
$this->_varB = $keys;
parent::__construct($keys->getIterator());
}
}
$obj = new ObjB(new ArrayObject());
var_dump($obj == unserialize(serialize($obj)));
--EXPECTF--
bool(true)