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--EXPECT-- 18foo 19Works 20