xref: /PHP-8.0/ext/spl/tests/bug54323.phpt (revision 7aacc705)
1--TEST--
2Bug #54323 (Accessing unset()'ed ArrayObject's property causes crash)
3--FILE--
4<?php
5class C {
6        public $prop = 'C::prop.orig';
7}
8class MyArrayObject extends ArrayObject {
9}
10$c = new C;
11$ao = new MyArrayObject($c);
12testAccess($c, $ao);
13function testAccess($c, $ao) {
14        foreach ($ao as $key=>$value) {
15        }
16        unset($ao['prop']);
17        var_dump($c->prop, $ao['prop']);
18}
19?>
20--EXPECTF--
21Warning: Undefined property: C::$prop in %s on line %d
22
23Warning: Undefined array key "prop" in %s on line %d
24NULL
25NULL
26