diff options
author | Marcus Boerger <helly@php.net> | 2004-01-22 21:55:09 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-01-22 21:55:09 +0000 |
commit | 95c15b024a41b3fc67e124530df9c5362cdd1702 (patch) | |
tree | aeaa07e23f09838c176dfd45432e238ddee5a473 /ext/simplexml | |
parent | 66ed0a49faefe0d5d56142aeee8e15f80ad3e23f (diff) | |
download | php-git-95c15b024a41b3fc67e124530df9c5362cdd1702.tar.gz |
Add new test
Diffstat (limited to 'ext/simplexml')
-rwxr-xr-x | ext/simplexml/tests/bug27010.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/simplexml/tests/bug27010.phpt b/ext/simplexml/tests/bug27010.phpt new file mode 100755 index 0000000000..dffb7476b6 --- /dev/null +++ b/ext/simplexml/tests/bug27010.phpt @@ -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=== |