3v4l.org

run code in 500+ PHP versions simultaneously
<?php $myArrays = array( array(1, 2, 3, 4), array(5, 6, 7, 8), array(9, 10, 11, 12), array(13, 14, 15, 16) ); foreach ($myArrays as $index => $myArray) { if (($index % 2) != 0) { echo implode("\n", array_reverse(array_column($myArrays, $index))) . "\n"; } else { echo implode("\n", array_column($myArrays, $index)) . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 26
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 26
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/RNC9R
function name:  (null)
number of ops:  28
compiled vars:  !0 = $myArrays, !1 = $myArray, !2 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1      > FE_RESET_R                                           $4      !0, ->26
          2    > > FE_FETCH_R                                           ~5      $4, !1, ->26
          3    >   ASSIGN                                                       !2, ~5
   12     4        MOD                                                  ~7      !2, 2
          5        IS_NOT_EQUAL                                                 ~7, 0
          6      > JMPZ                                                         ~8, ->18
   13     7    >   INIT_FCALL                                                   'array_reverse'
          8        INIT_FCALL                                                   'array_column'
          9        SEND_VAR                                                     !0
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                             $9      
         12        SEND_VAR                                                     $9
         13        DO_ICALL                                             $10     
         14        FRAMELESS_ICALL_2                implode             ~11     '%0A', $10
         15        CONCAT                                               ~12     ~11, '%0A'
         16        ECHO                                                         ~12
   12    17      > JMP                                                          ->25
   15    18    >   INIT_FCALL                                                   'array_column'
         19        SEND_VAR                                                     !0
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                             $13     
         22        FRAMELESS_ICALL_2                implode             ~14     '%0A', $13
         23        CONCAT                                               ~15     ~14, '%0A'
         24        ECHO                                                         ~15
   11    25    > > JMP                                                          ->2
         26    >   FE_FREE                                                      $4
   17    27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
237.13 ms | 2251 KiB | 15 Q