/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/dom/tests/DOMNamedNodeMap_edge_case_offset.phpt
29 строк
606 B
Niels Dossche
Add edge-case testcase for offset in DOMNamedNodeMap
03 июл 2023, 21:20
03 июл 2023, 21:20
bccd924
Код
Авторство
О чём код?
--TEST-- Test edge case offsets in DOMNamedNodeMap --EXTENSIONS-- dom --FILE-- <?php $document = new DomDocument(); $root = $document->createElement('root'); $document->appendChild($root); $root->setAttribute('attrib', 'value'); var_dump($root->attributes->length); // Consistent with the method call try { var_dump($root->attributes[-1]); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } try { $root->attributes[][] = null; } catch (Throwable $e) { echo $e->getMessage(), "\n"; } ?> --EXPECT-- int(1) must be between 0 and 2147483647 Cannot access DOMNamedNodeMap without offset