3v4l.org

run code in 500+ PHP versions simultaneously
<?php $f=fn($a,$f)=>$a?[...array_shift($a),...$f(array_reverse($a?next($a)?array_map(null,...$a):array_chunk($a[0],1):$a),$f)]:$a; print_r( $f([[1, 2, 3, 4], [12, 13, 14, 5], [11, 16, 15, 6], [10, 9, 8, 7]], $f) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JDGfH
function name:  (null)
number of ops:  10
compiled vars:  !0 = $f
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        ASSIGN                                                       !0, ~1
    5     2        INIT_FCALL                                                   'print_r'
    6     3        INIT_DYNAMIC_CALL                                            !0
          4        SEND_VAL_EX                                                  <array>
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $3      
          7        SEND_VAR                                                     $3
    5     8        DO_ICALL                                                     
    7     9      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 39
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 30
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JDGfH
function name:  {closure:/in/JDGfH:3}
number of ops:  42
compiled vars:  !0 = $a, !1 = $f
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2      > JMPZ                                                         !0, ->39
          3    >   INIT_FCALL                                                   'array_shift'
          4        SEND_REF                                                     !0
          5        DO_ICALL                                             $2      
          6        INIT_ARRAY                                           ~3      
          7        ADD_ARRAY_UNPACK                                     ~3      $2
          8        INIT_DYNAMIC_CALL                                            !1
          9        INIT_FCALL                                                   'array_reverse'
         10      > JMPZ                                                         !0, ->30
         11    >   INIT_FCALL                                                   'next'
         12        SEND_REF                                                     !0
         13        DO_ICALL                                             $4      
         14      > JMPZ                                                         $4, ->22
         15    >   INIT_FCALL                                                   'array_map'
         16        SEND_VAL                                                     null
         17        SEND_UNPACK                                                  !0
         18        CHECK_UNDEF_ARGS                                             
         19        DO_ICALL                                             $5      
         20        QM_ASSIGN                                            ~6      $5
         21      > JMP                                                          ->28
         22    >   INIT_FCALL                                                   'array_chunk'
         23        FETCH_DIM_R                                          ~7      !0, 0
         24        SEND_VAL                                                     ~7
         25        SEND_VAL                                                     1
         26        DO_ICALL                                             $8      
         27        QM_ASSIGN                                            ~6      $8
         28    >   QM_ASSIGN                                            ~9      ~6
         29      > JMP                                                          ->31
         30    >   QM_ASSIGN                                            ~9      !0
         31    >   SEND_VAL                                                     ~9
         32        DO_ICALL                                             $10     
         33        SEND_VAR_NO_REF_EX                                           $10
         34        SEND_VAR_EX                                                  !1
         35        DO_FCALL                                          0  $11     
         36        ADD_ARRAY_UNPACK                                     ~3      $11
         37        QM_ASSIGN                                            ~12     ~3
         38      > JMP                                                          ->40
         39    >   QM_ASSIGN                                            ~12     !0
         40    > > RETURN                                                       ~12
         41*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.39 ms | 2335 KiB | 19 Q