3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $number = 28; $columnCount = 4; for($i = 1, $loopCounter = 1; $i <= $number; $i = $i + $columnCount, $loopCounter++) { $range = range($i, $i+$columnCount - 1); if($loopCounter % 2 === 0) { $range = array_reverse($range); } foreach($range as $n) { echo str_pad($n, 2, ' ', STR_PAD_LEFT) . " "; } echo "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 5
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 30
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 5
Branch analysis from position: 38
Branch analysis from position: 5
Branch analysis from position: 30
Branch analysis from position: 19
filename:       /in/7QMGl
function name:  (null)
number of ops:  39
compiled vars:  !0 = $number, !1 = $columnCount, !2 = $i, !3 = $loopCounter, !4 = $range, !5 = $n
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, 28
   4     1        ASSIGN                                                   !1, 4
   6     2        ASSIGN                                                   !2, 1
         3        ASSIGN                                                   !3, 1
         4      > JMP                                                      ->36
   7     5    >   INIT_FCALL                                               'range'
         6        SEND_VAR                                                 !2
         7        ADD                                              ~10     !2, !1
         8        SUB                                              ~11     ~10, 1
         9        SEND_VAL                                                 ~11
        10        DO_ICALL                                         $12     
        11        ASSIGN                                                   !4, $12
   9    12        MOD                                              ~14     !3, 2
        13        IS_IDENTICAL                                     ~15     ~14, 0
        14      > JMPZ                                                     ~15, ->19
  10    15    >   INIT_FCALL                                               'array_reverse'
        16        SEND_VAR                                                 !4
        17        DO_ICALL                                         $16     
        18        ASSIGN                                                   !4, $16
  13    19    > > FE_RESET_R                                       $18     !4, ->30
        20    > > FE_FETCH_R                                               $18, !5, ->30
  14    21    >   INIT_FCALL                                               'str_pad'
        22        SEND_VAR                                                 !5
        23        SEND_VAL                                                 2
        24        SEND_VAL                                                 '+'
        25        SEND_VAL                                                 0
        26        DO_ICALL                                         $19     
        27        CONCAT                                           ~20     $19, '+'
        28        ECHO                                                     ~20
        29      > JMP                                                      ->20
        30    >   FE_FREE                                                  $18
  17    31        ECHO                                                     '%0A'
   6    32        ADD                                              ~21     !2, !1
        33        ASSIGN                                                   !2, ~21
        34        POST_INC                                         ~23     !3
        35        FREE                                                     ~23
        36    >   IS_SMALLER_OR_EQUAL                              ~24     !2, !0
        37      > JMPNZ                                                    ~24, ->5
  19    38    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0