3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $size = 5; for($i=1; $i <= $size; $i++) { echo $i, ' '; } echo PHP_EOL; for($i=2; $i <= $size-1; $i++) { echo $i, str_repeat(' ', ($size-1) * 2) - 1, $size - $i, PHP_EOL; } for($i=$size; $i > 0; $i--) { echo $i, ' '; }
based on hoYXK
Output for 7.1.0 - 7.2.0
1 2 3 4 5 2 Warning: A non-numeric value encountered in /in/TC8GC on line 9 -13 3 Warning: A non-numeric value encountered in /in/TC8GC on line 9 -12 4 Warning: A non-numeric value encountered in /in/TC8GC on line 9 -11 5 4 3 2 1
Output for 5.3.19 - 7.0.20
1 2 3 4 5 2-13 3-12 4-11 5 4 3 2 1