3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = 'bar'; print "regular string ... "; var_dump(empty($foo)); #Should be false $xml = simplexml_load_string("<xml><something>somevalue</something></xml>"); $xml2 = simplexml_load_string("<xml>\n<something>somevalue</something>\n</xml>"); foreach($xml as $key => $value) { var_dump($value); } foreach($xml2 as $key => $value) { var_dump($value); }
Output for 5.0.0 - 5.3.29, 5.5.27 - 5.5.38, 5.6.11 - 5.6.28, 7.0.0 - 7.1.0
regular string ... bool(false) object(SimpleXMLElement)#4 (1) { [0]=> string(9) "somevalue" } object(SimpleXMLElement)#5 (1) { [0]=> string(9) "somevalue" }
Output for hhvm-3.12.0
regular string ... bool(false) object(SimpleXMLElement)#4 (1) { [0]=> string(9) "somevalue" } object(SimpleXMLElement)#6 (1) { [0]=> string(9) "somevalue" }
Output for hhvm-3.10.0
regular string ... bool(false) object(SimpleXMLElement)#4 (1) { [0]=> string(9) "somevalue" } object(SimpleXMLElement)#6 (0) { }
Output for 5.4.0 - 5.5.26, 5.6.0 - 5.6.10
regular string ... bool(false) object(SimpleXMLElement)#4 (1) { [0]=> string(9) "somevalue" } object(SimpleXMLElement)#5 (0) { }
Output for 4.4.5 - 4.4.9
regular string ... bool(false) Fatal error: Call to undefined function: simplexml_load_string() in /in/7vXEg on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
regular string ... bool(false) Fatal error: Call to undefined function: simplexml_load_string() in /in/7vXEg on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
regular string ... bool(false) Fatal error: Call to undefined function: simplexml_load_string() in /in/7vXEg on line 6