3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new ArrayObject(array()); var_dump(iterator_to_array(new LimitIterator($a, 20, -1)));
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught TypeError: Argument 1 passed to LimitIterator::__construct() must implement interface Iterator, instance of ArrayObject given in /in/8iTM8:3 Stack trace: #0 /in/8iTM8(3): LimitIterator->__construct(Object(ArrayObject), 20, -1) #1 {main} thrown in /in/8iTM8 on line 3
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/8iTM8:3 Stack trace: #0 /in/8iTM8(3): LimitIterator->rewind() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.2.0 - 5.6.28
Catchable fatal error: Argument 1 passed to LimitIterator::__construct() must implement interface Iterator, instance of ArrayObject given in /in/8iTM8 on line 3
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to LimitIterator::__construct() must implement interface Iterator in /in/8iTM8 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function iterator_to_array() in /in/8iTM8 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/8iTM8 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/8iTM8 on line 2