3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function xrange($start, $limit, $step = 1) { $array = array(); for ($i = $start; $i <= $limit; $i += $step) { $array[] = $i; } return $array; } foreach (xrange(0, 100, 5) as $i) { print $i . PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 0PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 5PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 10PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 15PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 20PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 25PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 30PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 35PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 40PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 45PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 50PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 55PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 60PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 65PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 70PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 75PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 80PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 85PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 90PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 95PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3Gu7K on line 10 100PHP_EOL