3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <?xml version='1.0'?> <document> <title>Forty What?</title> <from>Joe</from> <to>Jane <body> I know that's the answer -- but what's the question? </body> </document> XML; $xml = simplexml_load_string($string); if($xml == false) { throw new \Exception(); } print_r($xml);

preferences:
40.25 ms | 402 KiB | 5 Q