summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/020.phpt
blob: a2a328736cc9c60ac69ac6c3cf25af8ff400437a (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===