mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
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:
commit
f5bf90ef34
@ -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;
|
||||
|
31
ext/spl/tests/bug62672.phpt
Normal file
31
ext/spl/tests/bug62672.phpt
Normal 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)
|
Loading…
Reference in New Issue
Block a user