3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = new ArrayObject(array(1, 2)); $it = new ArrayIterator($array); while ($it->valid()) { echo $it->current(); $it->next(); } $array[] = 3; echo $it->valid() ? $it->current : "not valid";
Output for 7.0.0 - 7.1.0
12 Notice: Undefined property: ArrayIterator::$current in /in/OX0iA on line 15
Output for 5.0.0 - 5.6.28
12not valid
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/OX0iA on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/OX0iA on line 3