3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '<?xml version="1.0" encoding="UTF-8"?> <root a="b"> <row b="y"> <item s="t" /> </row> <row p="c"> <item y="n" /> </row> </root>'; $simple_xml = @simplexml_load_string($a); echo "The XML without new lines,tabs\n:"; $b = str_replace( array("\n", "\r", "\t"), "", $a ); echo "The Bug\n:"; $simple_xml = @simplexml_load_string($b); var_dump($simple_xml); echo json_encode($simple_xml);
Output for git.master, git.master_jit, rfc.property-hooks
The XML without new lines,tabs :The Bug :object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(1) { ["a"]=> string(1) "b" } ["row"]=> array(2) { [0]=> object(SimpleXMLElement)#1 (2) { ["@attributes"]=> array(1) { ["b"]=> string(1) "y" } ["item"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(1) { ["s"]=> string(1) "t" } } } [1]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["p"]=> string(1) "c" } ["item"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(1) { ["y"]=> string(1) "n" } } } } } {"@attributes":{"a":"b"},"row":[{"@attributes":{"b":"y"},"item":{"@attributes":{"s":"t"}}},{"@attributes":{"p":"c"},"item":{"@attributes":{"y":"n"}}}]}

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

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


preferences:
60.73 ms | 403 KiB | 8 Q