php-src/ext/simplexml/tests/bug27010.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

33 lines
762 B
PHP

--TEST--
Bug #27010 (segfault and node text not displayed when returned from children())
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml=<<<EOF
<drinks xmlns:hot="http://www.example.com/hot">
<hot:drink><hot:name>Coffee</hot:name></hot:drink>
<hot:drink><hot:name>Tea</hot:name></hot:drink>
<drink><name>Cola</name></drink>
<drink><name>Juice</name></drink>
</drinks>
EOF;
$sxe = simplexml_load_string($xml);
foreach ($sxe as $element_name => $element) {
print "$element_name is $element->name\n";
}
foreach ($sxe->children('http://www.example.com/hot') as $element_name => $element) {
print "$element_name is $element->name\n";
}
?>
--EXPECT--
drink is Cola
drink is Juice
drink is Coffee
drink is Tea