3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $example = simplexml_load_string('<example xmlns:a="urn:a"><a:foo bar="baz"/></example>'); $a = $example->children('a', true); $bar = (string) $a->foo->children('', true)->attributes()->bar; var_dump($bar);
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: main(): Node no longer exists in /in/DhFOB on line 8 Warning: main(): Node no longer exists in /in/DhFOB on line 8 string(0) ""
Output for hhvm-3.10.0 - 3.12.0
string(0) ""
Output for 5.0.0 - 5.1.6
Warning: SimpleXMLElement::children() expects at most 1 parameter, 2 given in /in/DhFOB on line 6 Notice: Trying to get property of non-object in /in/DhFOB on line 8 Fatal error: Call to a member function children() on a non-object in /in/DhFOB on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/DhFOB on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/DhFOB on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/DhFOB on line 8
Process exited with code 255.