3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d=6; $num=1; for($a=1;$a<=$d;$a++) { for($b=0;$b<=$a;$b++) { echo "$a "; $num++; } echo "$num "; }
based on BBZNS
Output for 4.3.0 - 7.1.0
1 1 3 2 2 2 6 3 3 3 3 10 4 4 4 4 4 15 5 5 5 5 5 5 21 6 6 6 6 6 6 6 28