3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dev_id = 1; $insert_rp = ""; $personnel = array('Josh Haywood', 'Josh Cubbison', 'Brian Kang'); $it_personnel = new ArrayIterator($personnel); $c_personnel = new CachingIterator($it_personnel); foreach($c_personnel as $pers) { $insert_rp .= "($pers, $dev_id)"; if ($c_personnel->hasNext()) { $insert_rp .= ","; } } echo $insert_rp; ?>
based on IS4e3
Output for 5.0.0 - 7.2.0
(Josh Haywood, 1),(Josh Cubbison, 1),(Brian Kang, 1)
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/TDGlH on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/TDGlH on line 5