3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new ArrayObject(array()); $a = $a->getIterator(); var_dump(iterator_to_array(new LimitIterator($a, 20, -1)));
based on MRqd9
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught OutOfBoundsException: Seek position 20 is out of range in /in/jTuZE:1 Stack trace: #0 [internal function]: ArrayIterator->seek(20) #1 [internal function]: LimitIterator->rewind() #2 /in/jTuZE(1): iterator_to_array(Object(LimitIterator)) #3 {main} thrown in /in/jTuZE on line 1
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught exception 'OutOfBoundsException' with message 'Seek position 20 is out of range' in /in/jTuZE:1 Stack trace: #0 /in/jTuZE(1): LimitIterator->rewind() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.1.5 - 5.6.28
Notice: ArrayIterator::seek(): Array was modified outside object and internal position is no longer valid in /in/jTuZE on line 1 Fatal error: Uncaught exception 'OutOfBoundsException' with message 'Seek position 20 is out of range' in /in/jTuZE:1 Stack trace: #0 [internal function]: ArrayIterator->seek(20) #1 [internal function]: LimitIterator->rewind() #2 /in/jTuZE(1): iterator_to_array(Object(LimitIterator)) #3 {main} thrown in /in/jTuZE on line 1
Process exited with code 255.
Output for 5.1.0 - 5.1.4
Notice: ArrayIterator::seek(): Array was modified outside object and internal position is no longer valid in /in/jTuZE on line 1 Fatal error: Couldn't execute method LimitIterator::valid in Unknown on line 0
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function iterator_to_array() in /in/jTuZE on line 1
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/jTuZE on line 1
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/jTuZE on line 1