mirror of
https://github.com/php/php-src.git
synced 2025-01-24 04:33:39 +08:00
Add new test
This commit is contained in:
parent
66ed0a49fa
commit
95c15b024a
31
ext/simplexml/tests/bug27010.phpt
Executable file
31
ext/simplexml/tests/bug27010.phpt
Executable file
@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
#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===
|
Loading…
Reference in New Issue
Block a user