3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str=<<<XML <scales> <scale id="1" gender="*" age="*"> <d>5</d> <d>9</d> </scale> <scale id="2" gender="m" age="*"> <d>3</d> <d>0</d> </scale> <scale id="3" gender="*" age="19-39"> <d>12</d> <d>19</d> </scale> </scales> XML; $xml=simplexml_load_string($str); $result=$xml->xpath('//scale[@gender="*" or @gender="m"][@age="*" or @age="39-59"]'); foreach($result as $node) { echo $node->id."\n"; }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/tX7Co</b> on line <b>18</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/tX7Co</b> on line <b>18</b><br />
Process exited with code 255.
Output for 4.4.2
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/tX7Co</b> on line <b>19</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/tX7Co</b> on line <b>18</b><br />