3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create an array with 0 value $array = array(0); // Iterate over the array, var_dump each value // At the same time, set the next value to "lolcats" foreach ($array as $key => &$val) { var_dump($val); if($key < 10) { $array[++$key] = "lolcats"; } } // Finally var_dump the $array var_dump($array);

preferences:
38.62 ms | 402 KiB | 5 Q