summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/020.phpt
blob: 9e91b5ac3a976cff8250c87b57fe94cf4d9450a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
SimpleXML: Attribute compared to string
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?> 
--FILE--
<?php

$doc = simplexml_load_string('<root><name attr="foo">bar</name></root>');
print $doc->name["attr"];
print "\n";
if ($doc->name["attr"] == "foo") {
         print "Works\n";
} else {
         print "Error\n";
}
?>
===DONE===
--EXPECT--
foo
Works
===DONE===