3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $response = '<?xml version="1.0" encoding="utf-8"?> <PostResponse><Status>success</Status><Price>10.00</Price><Message>Test successful.</Message><ConfirmationId>6</ConfirmationId></PostResponse>'; $xmlResponse = new SimpleXMLElement($response); $errorCode = $xmlResponse->Status; var_dump($errorCode[0]);
based on Kjaeh
Output for 5.0.0 - 5.3.29, 5.5.27 - 5.5.35, 5.6.11 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
object(SimpleXMLElement)#4 (1) { [0]=> string(7) "success" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.5.26, 5.6.7 - 5.6.10
object(SimpleXMLElement)#4 (0) { }
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/tZoHd on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/tZoHd on line 6