/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/ArrayObject/arrayObject___construct_basic7.phpt
35 строк
659 B
Gina Peter Banyard
ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)
14 авг 2025, 14:38
Не верифицирован
14 авг 2025, 14:38
fb87b14
Код
Авторство
О чём код?
--TEST-- SPL: ArrayObject::__construct: Using object with shared properties --FILE-- <?php $y = 2; $x = 1; $a = array($y, $x); $o = (object)$a; $ao = new ArrayObject($o); $ao->asort(); var_dump($a, $o, $ao); ?> --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) { [0]=> int(2) [1]=> int(1) } object(stdClass)#1 (2) { ["1"]=> int(1) ["0"]=> int(2) } object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> object(stdClass)#1 (2) { ["1"]=> int(1) ["0"]=> int(2) } }