3v4l.org

run code in 200+ PHP versions simultaneously
<?php $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <root> <item> <foo id=\"1\"><![CDATA[123]]></foo> <bar><![CDATA[abc]]></bar> </item> <item> <foo id=\"1\">123</foo> <bar>abc</bar> </item> </root>"; $sxml = simplexml_load_string($xml, null, LIBXML_NOCDATA); print_r($sxml); print_r($sxml->item[0]->foo["id"]);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
SimpleXMLElement Object ( [item] => Array ( [0] => SimpleXMLElement Object ( [foo] => 123 [bar] => abc ) [1] => SimpleXMLElement Object ( [foo] => 123 [bar] => abc ) ) ) SimpleXMLElement Object ( [0] => 1 )
Output for branch php-master+opcache
SimpleXMLElement Object ( [item] => Array ( [0] => SimpleXMLElement Object ( [foo] => 123 [bar] => abc ) [1] => SimpleXMLElement Object ( [foo] => 123 [bar] => abc ) ) ) SimpleXMLElement Object ( [0] => 1 )

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page