xref: /PHP-8.0/ext/spl/tests/bug41528.phpt (revision 2196a52e)
1--TEST--
2Bug #41528 (Classes extending ArrayObject do not serialize correctly)
3--FILE--
4<?php
5class ClassOne extends ArrayObject
6{
7    public $a = 2;
8}
9
10$classOne    = new ClassOne();
11$classOne->a = 1;
12
13var_dump($classOne);
14var_dump($classOne->a);
15
16$classOne = unserialize(serialize($classOne));
17
18var_dump($classOne);
19var_dump($classOne->a);
20?>
21--EXPECT--
22object(ClassOne)#1 (2) {
23  ["a"]=>
24  int(1)
25  ["storage":"ArrayObject":private]=>
26  array(0) {
27  }
28}
29int(1)
30object(ClassOne)#2 (2) {
31  ["a"]=>
32  int(1)
33  ["storage":"ArrayObject":private]=>
34  array(0) {
35  }
36}
37int(1)
38