3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(!class_exists('SimpleXMLElement')) die("Bonkers"); $xml = new SimpleXMLElement('<xml><node>foo</node></xml>'); var_dump($xml->node); var_dump(gettype($xml->node)); var_dump(gettype($xml->node->foo)); var_dump(isset($xml->node->foo)); var_dump(is_null($xml->node->foo));
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
object(SimpleXMLElement)#2 (1) { [0]=> string(3) "foo" } string(6) "object" string(6) "object" bool(false) bool(false)
Output for 4.3.0 - 4.4.9
Bonkers