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) ); $index = 0; $myArrays = array_map(function ($v) use (&$index, $myArrays) { if (($index % 2) != 0) { echo implode("\n", array_reverse(array_column($myArrays, $index))) . "\n"; } else { echo implode("\n", array_column($myArrays, $index)) . "\n"; } $index++; }, $myArrays);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m2jZ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $myArrays, !1 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, 0
   11     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          4        BIND_LEXICAL                                                 ~4, !1
          5        BIND_LEXICAL                                                 ~4, !0
   19     6        SEND_VAL                                                     ~4
          7        SEND_VAR                                                     !0
   11     8        DO_ICALL                                             $5      
          9        ASSIGN                                                       !0, $5
   19    10      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m2jZ
function name:  {closure:/in/0m2jZ:11}
number of ops:  26
compiled vars:  !0 = $v, !1 = $index, !2 = $myArrays
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
   12     3        MOD                                                  ~3      !1, 2
          4        IS_NOT_EQUAL                                                 ~3, 0
          5      > JMPZ                                                         ~4, ->17
   13     6    >   INIT_FCALL                                                   'array_reverse'
          7        INIT_FCALL                                                   'array_column'
          8        SEND_VAR                                                     !2
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $5      
         11        SEND_VAR                                                     $5
         12        DO_ICALL                                             $6      
         13        FRAMELESS_ICALL_2                implode             ~7      '%0A', $6
         14        CONCAT                                               ~8      ~7, '%0A'
         15        ECHO                                                         ~8
   12    16      > JMP                                                          ->24
   15    17    >   INIT_FCALL                                                   'array_column'
         18        SEND_VAR                                                     !2
         19        SEND_VAR                                                     !1
         20        DO_ICALL                                             $9      
         21        FRAMELESS_ICALL_2                implode             ~10     '%0A', $9
         22        CONCAT                                               ~11     ~10, '%0A'
         23        ECHO                                                         ~11
   18    24    >   PRE_INC                                                      !1
   19    25      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.23 ms | 2184 KiB | 16 Q