Annotation of embedaddon/php/ext/simplexml/tests/bug41947.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #41947 (addChild incorrectly registers empty strings as namespaces)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7: $xml = simplexml_load_string('<?xml version="1.0" encoding="utf-8"?><root xmlns:myns="http://myns" />');
! 8: $grandchild = $xml->addChild('child', null, 'http://myns')->addChild('grandchild', 'hello', '');
! 9:
! 10: $gchild = $xml->xpath("//grandchild");
! 11: if (count($gchild) > 0) {
! 12: echo $gchild[0]."\n";
! 13: }
! 14: ?>
! 15: ===DONE===
! 16: --EXPECT--
! 17: hello
! 18: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>