/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/simplexml/tests/getDocNamespaces_no_internal_declaration.phpt
57 строк
952 B
Niels Dossche
Update ext/dom names after policy change (#14171)
09 май 2024, 11:40
Не верифицирован
09 май 2024, 11:40
6e7adb3
Код
Авторство
О чём код?
--TEST-- getDocNamespaces() without internal namespace declaration in the document --EXTENSIONS-- simplexml dom --FILE-- <?php $xml = <<<XML <root> <child xmlns="urn:a"> <a/> <b xmlns=""/> <c xmlns:a="urn:a" xmlns="urn:c"/> </child> <child2 xmlns:d="urn:d"/> </root> XML; $sxe = simplexml_load_string($xml); var_dump($sxe->getDocNamespaces(true)); $dom = new DOMDocument; $dom->loadXML($xml); $sxe = simplexml_import_dom($dom); var_dump($sxe->getDocNamespaces(true)); $dom = Dom\XMLDocument::createFromString($xml); $sxe = simplexml_import_dom($dom); var_dump($sxe->getDocNamespaces(true)); ?> --EXPECT-- array(3) { [""]=> string(5) "urn:a" ["a"]=> string(5) "urn:a" ["d"]=> string(5) "urn:d" } array(3) { [""]=> string(5) "urn:a" ["a"]=> string(5) "urn:a" ["d"]=> string(5) "urn:d" } array(3) { [""]=> string(5) "urn:a" ["a"]=> string(5) "urn:a" ["d"]=> string(5) "urn:d" }