3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Crea un iterador a limitar $frutas = new ArrayIterator(array( 'manzana', 'banana', 'cereza', 'ciruela', 'baya' )); // Estamos pidiendo elementos a partir de una posiciĆ³n que no existe foreach (new LimitIterator($frutas, 2, 3) as $fruta) { var_dump($fruta); }
based on 7jSTk
Output for 5.0.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
string(6) "cereza" string(7) "ciruela" string(4) "baya"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.0.1
string(6) "banana" string(6) "cereza" string(7) "ciruela"
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/rAVqb on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/rAVqb on line 4