3v4l.org

run code in 300+ 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 = 32
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 32
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/RNC9R
function name:  (null)
number of ops:  34
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, ->32
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->32
          3    >   ASSIGN                                                   !2, ~5
   12     4        MOD                                              ~7      !2, 2
          5        IS_NOT_EQUAL                                             ~7, 0
          6      > JMPZ                                                     ~8, ->21
   13     7    >   INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '%0A'
          9        INIT_FCALL                                               'array_reverse'
         10        INIT_FCALL                                               'array_column'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                         $10     
         16        SEND_VAR                                                 $10
         17        DO_ICALL                                         $11     
         18        CONCAT                                           ~12     $11, '%0A'
         19        ECHO                                                     ~12
   12    20      > JMP                                                      ->31
   15    21    >   INIT_FCALL                                               'implode'
         22        SEND_VAL                                                 '%0A'
         23        INIT_FCALL                                               'array_column'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $13     
         27        SEND_VAR                                                 $13
         28        DO_ICALL                                         $14     
         29        CONCAT                                           ~15     $14, '%0A'
         30        ECHO                                                     ~15
   11    31    > > JMP                                                      ->2
         32    >   FE_FREE                                                  $4
   17    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.88 ms | 1001 KiB | 16 Q