Annotation of embedaddon/php/ext/simplexml/tests/bug27010.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #27010 (segfault and node text not displayed when returned from children())
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: $xml=<<<EOF
                      9: <drinks xmlns:hot="http://www.example.com/hot">
                     10:  <hot:drink><hot:name>Coffee</hot:name></hot:drink>
                     11:  <hot:drink><hot:name>Tea</hot:name></hot:drink>
                     12:  <drink><name>Cola</name></drink>
                     13:  <drink><name>Juice</name></drink>
                     14: </drinks>
                     15: EOF;
                     16: 
                     17: $sxe = simplexml_load_string($xml);
                     18: 
                     19: foreach ($sxe as $element_name => $element) {
                     20:     print "$element_name is $element->name\n";
                     21: }
                     22: 
                     23: foreach ($sxe->children('http://www.example.com/hot') as $element_name => $element) {
                     24:     print "$element_name is $element->name\n";
                     25: }
                     26: 
                     27: ?>
                     28: ===DONE===
                     29: --EXPECT--
                     30: drink is Cola
                     31: drink is Juice
                     32: drink is Coffee
                     33: drink is Tea
                     34: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>