diff options
Diffstat (limited to 'ext/simplexml/tests/020.phpt')
-rw-r--r-- | ext/simplexml/tests/020.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/simplexml/tests/020.phpt b/ext/simplexml/tests/020.phpt new file mode 100644 index 0000000..9e91b5a --- /dev/null +++ b/ext/simplexml/tests/020.phpt @@ -0,0 +1,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=== |