xref: /PHP-5.4/ext/simplexml/tests/020.phpt (revision 610c7fbe)
1--TEST--
2SimpleXML: Attribute compared to string
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip"; ?>
5--FILE--
6<?php
7
8$doc = simplexml_load_string('<root><name attr="foo">bar</name></root>');
9print $doc->name["attr"];
10print "\n";
11if ($doc->name["attr"] == "foo") {
12         print "Works\n";
13} else {
14         print "Error\n";
15}
16?>
17===DONE===
18--EXPECT--
19foo
20Works
21===DONE===
22