mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
For rationale, see #6787 Extensions migrated in part 4: * simplexml * skeleton * soap * spl * sqlite3 * sysvmsg * sysvsem * tidy - also removed a check for an ancient dependency version
33 lines
717 B
PHP
33 lines
717 B
PHP
--TEST--
|
|
Bug #27010 (segfault and node text not displayed when returned from children())
|
|
--EXTENSIONS--
|
|
simplexml
|
|
--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
|