/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/xmlreader/tests/cache_slot.phpt
58 строк
963 B
Niels Dossche
Implement cache slot optimization for XMLReader (#17232)
22 дек 2024, 15:01
Не верифицирован
22 дек 2024, 15:01
d480c04
Код
Авторство
О чём код?
--TEST-- Cache slot test --EXTENSIONS-- xmlreader --FILE-- <?php class Test1 { function __construct(public string $localName) {} } #[AllowDynamicProperties] class Test2 extends XMLReader { } function readLocalName($obj) { for ($i = 0; $i < 2; $i++) var_dump($obj->localName); } function readTestProp($obj) { for ($i = 0; $i < 2; $i++) var_dump($obj->testProp); } $reader = XMLReader::fromString("<root/>"); $reader->read(); $test1 = new Test1("hello"); readLocalName($reader); readLocalName($test1); readLocalName($reader); $test2 = new Test2; $test2->testProp = 1; readTestProp($test2); readTestProp($reader); readTestProp($test2); ?> --EXPECTF-- string(4) "root" string(4) "root" string(5) "hello" string(5) "hello" string(4) "root" string(4) "root" int(1) int(1) Warning: Undefined property: XMLReader::$testProp in %s on line %d NULL Warning: Undefined property: XMLReader::$testProp in %s on line %d NULL int(1) int(1)