mirror of
https://github.com/php/php-src.git
synced 2026-04-21 06:51:18 +02:00
. Fix memleaks . Add tests . Add functions: getNamespaces(), getDocNamespaces() . Fixed var_dump() . Fixed bugs: #35028 XML object fails FALSE test # This plan was decided before 5.1.0 came out with ilia and checked again # just now. The extension currently shows no more memleaks or errors using # the test suite.
33 lines
714 B
PHP
Executable File
33 lines
714 B
PHP
Executable File
--TEST--
|
|
Bug #27010 (segfault and node text not displayed when returned from children())
|
|
--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";
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
drink is Cola
|
|
drink is Juice
|
|
drink is Coffee
|
|
drink is Tea
|
|
===DONE===
|