3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = range("A", "E"); // 5 elements ; foreach ( new LimitIterator(new InfiniteIterator(new ArrayIterator($array)), 25, 5) as $chr ) { echo $chr, PHP_EOL; }
Output for 5.1.0 - 7.1.0
A B C D E
Output for 5.0.1 - 5.0.5
Fatal error: Class 'InfiniteIterator' not found in /in/CvEtC on line 3 Fatal error: Unknown: The inner constructor wasn't initialized with an iterator instance in Unknown on line 0
Process exited with code 255.
Output for 5.0.0
Fatal error: Class 'InfiniteIterator' not found in /in/CvEtC on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: limititerator in /in/CvEtC on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: limititerator in /in/CvEtC on line 3