mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects This also moves tests into a subfolder.
28 lines
717 B
PHP
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
|