xref: /PHP-8.0/ext/spl/tests/bug77298.phpt (revision 7aacc705)
1--TEST--
2Bug #77298 (segfault occurs when add property to unserialized ArrayObject)
3--FILE--
4<?php
5$o = new ArrayObject();
6$o2 = unserialize(serialize($o));
7$o2[1]=123;
8var_dump($o2);
9
10$o3 = new ArrayObject();
11$o3->unserialize($o->serialize());
12$o3['xm']=456;
13var_dump($o3);
14?>
15--EXPECT--
16object(ArrayObject)#2 (1) {
17  ["storage":"ArrayObject":private]=>
18  array(1) {
19    [1]=>
20    int(123)
21  }
22}
23object(ArrayObject)#3 (1) {
24  ["storage":"ArrayObject":private]=>
25  array(1) {
26    ["xm"]=>
27    int(456)
28  }
29}
30