mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
15 lines
407 B
Plaintext
15 lines
407 B
Plaintext
|
--TEST--
|
||
|
Bug #41947 (addChild incorrectly registers empty strings as namespaces)
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$xml = simplexml_load_string('<?xml version="1.0" encoding="utf-8"?><root xmlns:myns="http://myns" />');
|
||
|
$grandchild = $xml->addChild('child', null, 'http://myns')->addChild('grandchild', 'hello', '');
|
||
|
|
||
|
$gchild = $xml->xpath("//grandchild");
|
||
|
if (count($gchild) > 0) {
|
||
|
echo $gchild[0];
|
||
|
}
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
hello
|