3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { libxml_use_internal_errors(true); return new SimpleXMLElement('<?xml version="1.0"?><test><b>Fart</test></b>); } catch (\Exception $e) { $xml = new SimpleXMLElement('<errors/>'); foreach(libxml_get_errors() as $error) { $xml->addChild('error', $error->message); }; libxml_clear_errors(); echo $xml; }
Output for 7.1.25 - 7.1.31, 7.2.0 - 7.2.21, 7.3.0 - 7.3.8
Parse error: syntax error, unexpected '>' in /in/PKPcM on line 6
Process exited with code 255.

preferences:
176.98 ms | 1390 KiB | 46 Q