/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/ArrayObject/bug54323.phpt
27 строк
717 B
Gina Peter Banyard
ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)
14 авг 2025, 14:38
Не верифицирован
14 авг 2025, 14:38
fb87b14
Код
Авторство
О чём код?
--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