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) ); $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 = 20
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m2jZ
function name:  {closure}
number of ops:  32
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, ->20
   13     6    >   INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '%0A'
          8        INIT_FCALL                                               'array_reverse'
          9        INIT_FCALL                                               'array_column'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                         $6      
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                         $7      
         17        CONCAT                                           ~8      $7, '%0A'
         18        ECHO                                                     ~8
   12    19      > JMP                                                      ->30
   15    20    >   INIT_FCALL                                               'implode'
         21        SEND_VAL                                                 '%0A'
         22        INIT_FCALL                                               'array_column'
         23        SEND_VAR                                                 !2
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $9      
         26        SEND_VAR                                                 $9
         27        DO_ICALL                                         $10     
         28        CONCAT                                           ~11     $10, '%0A'
         29        ECHO                                                     ~11
   18    30    >   PRE_INC                                                  !1
   19    31      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.69 ms | 1006 KiB | 17 Q