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->event as $event) { echo $event->{'@attributes'}['objectId'] . '<br/>'; }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<br/><br/><br/><br/><br/>
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmliterator in <b>/in/MRdpY</b> on line <b>11</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmliterator in <b>/in/MRdpY</b> on line <b>11</b><br />