3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = <<<XML <map> <title>Wisburn Village</title> <color1>0x0000FF</color1> <color2>0x2b8300</color2> <element id="tree_1"> <icon>7</icon> <scale>1</scale> </element> <element id="tree_2"> <icon>7</icon> <scale>1</scale> </element> <element id="tree_4"> <icon>7</icon> <scale>0.9</scale> </element> <element id="house1"> <icon>2</icon> <type>mission</type> <name>Home</name> </element> <element id="cave_1"> <type>mission</type> <icon>4</icon> <name>Den of Trials</name> <scale>0.9</scale> <mission id="01"> <name>Gloop and Bloop</name> <info>Let's see you fight some monsters in the den! These shouldn't prove much of a problem, show me what you can do!</info> <enemies> <enemy id="405"></enemy> <enemy id="405"></enemy> <enemy id="405"></enemy> </enemies> </mission> </element> <element id="link_1"> <type>link</type> <to>02</to> <name>to Quadra Plains</name> <lv>1</lv> </element> </map> XML; $xml = simplexml_load_string($x); $battleName = $xml->xpath("element[@id=01]/mission[@id=01]/name"); echo "<pre>"; var_dump($battleName); echo "</pre>";
Output for 5.2.14 - 5.2.17, 5.3.3 - 5.3.6, 5.3.9 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>array(0) { } </pre>
Output for 5.0.0 - 5.2.13, 5.3.0 - 5.3.2, 5.3.7 - 5.3.8
<pre>bool(false) </pre>
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/iWRPC on line 54
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/iWRPC on line 54
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/iWRPC on line 55
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/iWRPC on line 54