Annotation of embedaddon/php/ext/simplexml/tests/profile11.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SimpleXML [profile]: Accessing two elements with the same name, but different namespaces
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7: error_reporting(E_ALL & ~E_NOTICE);
! 8: $root = simplexml_load_string('<?xml version="1.0"?>
! 9: <root xmlns:reserved="reserved-ns" xmlns:special="special-ns">
! 10: <reserved:child>Hello</reserved:child>
! 11: <special:child>World</special:child>
! 12: </root>
! 13: ');
! 14:
! 15: var_dump($root->children('reserved-ns')->child);
! 16: var_dump($root->children('special-ns')->child);
! 17: var_dump((string)$root->children('reserved-ns')->child);
! 18: var_dump((string)$root->children('special-ns')->child);
! 19: var_dump($root->child);
! 20: ?>
! 21: ===DONE===
! 22: --EXPECTF--
! 23: object(SimpleXMLElement)#%d (1) {
! 24: [0]=>
! 25: string(5) "Hello"
! 26: }
! 27: object(SimpleXMLElement)#%d (1) {
! 28: [0]=>
! 29: string(5) "World"
! 30: }
! 31: string(5) "Hello"
! 32: string(5) "World"
! 33: object(SimpleXMLElement)#%d (0) {
! 34: }
! 35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>