php-src/ext/simplexml/tests/020.phpt

22 lines
392 B
Plaintext
Raw Normal View History

2004-03-14 15:33:15 +00:00
--TEST--
SimpleXML: Attribute compared to string
2004-03-14 15:33:15 +00:00
--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===