~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/simplexml/tests/profile11.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
echo $root->children('reserved-ns')->child;
 
16
echo "\n";
 
17
echo $root->children('special-ns')->child;
 
18
foreach ($root->child as $child) {
 
19
        echo "$child\n";
 
20
}
 
21
echo "\n---Done---\n";
 
22
?>
 
23
--EXPECT--
 
24
Hello
 
25
World
 
26
---Done---