3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = new ArrayObject(array(1, 2)); $it = $array->getIterator(); while ($it->valid()) { $it->next(); echo $it->offsetGet(0); } $it->append(array(3)); echo $it->valid() ? $it->current() : "not valid";
Output for hhvm-3.12.0, 7.0.0 - 7.1.0
11 Notice: Array to string conversion in /in/m7TIZ on line 16 Array
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.2.0 - 5.6.28
11 Catchable fatal error: ArrayIterator::append(): Cannot append properties to objects, use ArrayIterator::offsetSet() instead in /in/m7TIZ on line 14
Process exited with code 255.
Output for 5.1.0 - 5.1.6
11 Fatal error: ArrayIterator::append(): Cannot append properties to objects, use ArrayIterator::offsetSet() instead in /in/m7TIZ on line 14
Process exited with code 255.
Output for 5.0.0 - 5.0.5
11Array
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/m7TIZ 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/m7TIZ on line 3