/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/ArrayObject/ArrayObject_modify_shared_object_properties.phpt
20 строк
462 B
Gina Peter Banyard
ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)
14 авг 2025, 14:38
Не верифицирован
14 авг 2025, 14:38
fb87b14
Код
Авторство
О чём код?
--TEST-- Modifications to ArrayObjects should not affect shared properties tables --FILE-- <?php $obj = (object)['a' => 1, 'b' => 2]; $ao = new ArrayObject($obj); $arr = (array) $obj; $ao['a'] = 42; var_dump($arr); ?> --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 array(2) { ["a"]=> int(1) ["b"]=> int(2) }