mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
2196a52edd
- Checking that when you serialize a class that extends to ArrayObject Is keeping it's properties.
38 lines
572 B
PHP
38 lines
572 B
PHP
--TEST--
|
|
Bug #41528 (Classes extending ArrayObject do not serialize correctly)
|
|
--FILE--
|
|
<?php
|
|
class ClassOne extends ArrayObject
|
|
{
|
|
public $a = 2;
|
|
}
|
|
|
|
$classOne = new ClassOne();
|
|
$classOne->a = 1;
|
|
|
|
var_dump($classOne);
|
|
var_dump($classOne->a);
|
|
|
|
$classOne = unserialize(serialize($classOne));
|
|
|
|
var_dump($classOne);
|
|
var_dump($classOne->a);
|
|
?>
|
|
--EXPECT--
|
|
object(ClassOne)#1 (2) {
|
|
["a"]=>
|
|
int(1)
|
|
["storage":"ArrayObject":private]=>
|
|
array(0) {
|
|
}
|
|
}
|
|
int(1)
|
|
object(ClassOne)#2 (2) {
|
|
["a"]=>
|
|
int(1)
|
|
["storage":"ArrayObject":private]=>
|
|
array(0) {
|
|
}
|
|
}
|
|
int(1)
|