1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/spl/tests/ArrayObject/bug54323.phpt

28 lines
717 B
PHP

--TEST--
Bug #54323 (Accessing unset()'ed ArrayObject's property causes crash)
--FILE--
<?php
class C {
public $prop = 'C::prop.orig';
}
class MyArrayObject extends ArrayObject {
}
$c = new C;
$ao = new MyArrayObject($c);
testAccess($c, $ao);
function testAccess($c, $ao) {
foreach ($ao as $key=>$value) {
}
unset($ao['prop']);
var_dump($c->prop, $ao['prop']);
}
?>
--EXPECTF--
Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d
Warning: Undefined property: C::$prop in %s on line %d
Warning: Undefined array key "prop" in %s on line %d
NULL
NULL