--TEST-- SimpleXML: Attributes with entities --SKIPIF-- --FILE-- ]> EOF; $sxe = simplexml_load_string($xml); var_dump($sxe); var_dump($sxe['attr']); ?> --EXPECTF-- object(SimpleXMLElement)#%d (1) { ["@attributes"]=> array(1) { ["attr"]=> string(%d) "foo%sbar%sbaz" } } object(SimpleXMLElement)#%d (1) { [0]=> string(%d) "foo%sbar%sbaz" }