3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.17 - 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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<pre>array(0) { } </pre>
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.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.3.11, 4.4.0 - 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

preferences:
247.96 ms | 401 KiB | 380 Q