3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <condition type="or"> <event objType="s" objectId="144" eventType="tr" event="triggered"/> <event objType="s" objectId="149" eventType="tr" event="triggered"/> <event objType="s" objectId="159" eventType="tr" event="triggered"/> <event objType="s" objectId="160" eventType="tr" event="triggered"/> <event objType="s" objectId="145" eventType="tr" event="triggered"/> </condition>'; $obj = new SimpleXMLIterator($xml); foreach ($obj->condition->event as $event) { echo $event->objectId . '<br/>'; }
Output for 5.0.0 - 5.1.2, 5.2.1 - 5.6.28, 7.0.0 - 7.1.0
Warning: Invalid argument supplied for foreach() in /in/OGpLZ on line 12
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid argument supplied for foreach() in /in/OGpLZ on line 14
Output for 5.1.3 - 5.2.0
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmliterator in /in/OGpLZ on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmliterator in /in/OGpLZ on line 11