3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 100; // The last number $cols = 5; // The point at which a new line will start $arr = array_chunk(range(1, $max), $cols); // Magic ;D // Print the data. foreach ($arr as $key => $row) { // This will reverse every other row $row = ($key % 2 === 0) ? $row : array_reverse($row); foreach ($row as $value) { $value = str_pad($value, strlen($max), ' ', STR_PAD_LEFT); echo "{$value} "; } echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 41
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 41
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 38
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 38
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
Branch analysis from position: 38
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/NX3FS
function name:  (null)
number of ops:  43
compiled vars:  !0 = $max, !1 = $cols, !2 = $arr, !3 = $row, !4 = $key, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 100
    4     1        ASSIGN                                                   !1, 5
    5     2        INIT_FCALL                                               'array_chunk'
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $8      
          7        SEND_VAR                                                 $8
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !2, $9
    8    11      > FE_RESET_R                                       $11     !2, ->41
         12    > > FE_FETCH_R                                       ~12     $11, !3, ->41
         13    >   ASSIGN                                                   !4, ~12
   10    14        MOD                                              ~14     !4, 2
         15        IS_IDENTICAL                                             ~14, 0
         16      > JMPZ                                                     ~15, ->19
         17    >   QM_ASSIGN                                        ~16     !3
         18      > JMP                                                      ->23
         19    >   INIT_FCALL                                               'array_reverse'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $17     
         22        QM_ASSIGN                                        ~16     $17
         23    >   ASSIGN                                                   !3, ~16
   12    24      > FE_RESET_R                                       $19     !3, ->38
         25    > > FE_FETCH_R                                               $19, !5, ->38
   13    26    >   INIT_FCALL                                               'str_pad'
         27        SEND_VAR                                                 !5
         28        STRLEN                                           ~20     !0
         29        SEND_VAL                                                 ~20
         30        SEND_VAL                                                 '+'
         31        SEND_VAL                                                 0
         32        DO_ICALL                                         $21     
         33        ASSIGN                                                   !5, $21
   14    34        NOP                                                      
         35        FAST_CONCAT                                      ~23     !5, '+'
         36        ECHO                                                     ~23
   12    37      > JMP                                                      ->25
         38    >   FE_FREE                                                  $19
   16    39        ECHO                                                     '%0A'
    8    40      > JMP                                                      ->12
         41    >   FE_FREE                                                  $11
   17    42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.81 ms | 1400 KiB | 21 Q