xref: /PHP-5.5/ext/spl/tests/bug54323.phpt (revision f3108b5f)
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--EXPECTF--
20Notice: Undefined property: C::$prop in %sbug54323.php on line 14
21
22Notice: Undefined index: prop in %sbug54323.php on line 14
23NULL
24NULL
25