xref: /PHP-8.1/ext/spl/tests/array_026.phpt (revision 36935e42)
1--TEST--
2SPL: ArrayObject indirect offsetGet overwriting EG(uninitialized_zvar_ptr)
3--FILE--
4<?php
5$test = new ArrayObject();
6$test['d1']['d2'] = 'hello';
7$test['d1']['d3'] = 'world';
8var_dump($test, $test3['mmmmm']);
9?>
10--EXPECTF--
11Warning: Undefined variable $test3 in %s on line %d
12
13Warning: Trying to access array offset on value of type null in %s on line %d
14object(ArrayObject)#1 (1) {
15  ["storage":"ArrayObject":private]=>
16  array(1) {
17    ["d1"]=>
18    array(2) {
19      ["d2"]=>
20      string(5) "hello"
21      ["d3"]=>
22      string(5) "world"
23    }
24  }
25}
26NULL
27