3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = <<<EOT <?xml version="1.0" encoding="UTF-8"?> <Response> <Errors> <Error> <ErrorId>XML999</ErrorId> <ErrorText><![CDATA[cvc-complex-type: Invalid content was found starting with XXX. One of '{XXX}' is expected.]]></ErrorText> </Error> </Errors> </Response> EOT; $xml = simplexml_load_string($s); echo $xml->Errors->Error->ErrorId.PHP_EOL; echo $xml->Errors->Error->ErrorText.PHP_EOL; echo var_dump($xml);
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
XML999 cvc-complex-type: Invalid content was found starting with XXX. One of '{XXX}' is expected. object(SimpleXMLElement)#1 (1) { ["Errors"]=> object(SimpleXMLElement)#4 (1) { ["Error"]=> object(SimpleXMLElement)#2 (2) { ["ErrorId"]=> string(6) "XML999" ["ErrorText"]=> object(SimpleXMLElement)#3 (0) { } } } }

preferences:
173.72 ms | 403 KiB | 178 Q