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); list($test) = $xml->xpath("//type/@name"); echo $test;
Output for 5.3.0 - 7.1.0
Notice: Undefined offset: 0 in /in/LBjLl on line 56
Output for 5.0.0 - 5.1.1, 5.1.3 - 5.2.17
Notice: Undefined offset: 0 in /in/LBjLl on line 56
Output for 5.1.2
Notice: Undefined offset: 0 in /in/LBjLl on line 57
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/LBjLl 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/LBjLl on line 54
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/LBjLl 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/LBjLl on line 54