3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FJDGfH0x7f8c9167a013'
         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
         8        DO_ICALL                                                 
   7     9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJDGfH0x7f8c9167a013:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 38
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 29
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JDGfH
function name:  {closure}
number of ops:  41
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, ->38
         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, ->29
        11    >   INIT_FCALL                                               'next'
        12        SEND_REF                                                 !0
        13        DO_ICALL                                         $4      
        14      > JMPZ                                                     $4, ->21
        15    >   INIT_FCALL                                               'array_map'
        16        SEND_VAL                                                 null
        17        SEND_UNPACK                                              !0
        18        DO_ICALL                                         $5      
        19        QM_ASSIGN                                        ~6      $5
        20      > JMP                                                      ->27
        21    >   INIT_FCALL                                               'array_chunk'
        22        FETCH_DIM_R                                      ~7      !0, 0
        23        SEND_VAL                                                 ~7
        24        SEND_VAL                                                 1
        25        DO_ICALL                                         $8      
        26        QM_ASSIGN                                        ~6      $8
        27    >   QM_ASSIGN                                        ~9      ~6
        28      > JMP                                                      ->30
        29    >   QM_ASSIGN                                        ~9      !0
        30    >   SEND_VAL                                                 ~9
        31        DO_ICALL                                         $10     
        32        SEND_VAR_NO_REF_EX                                       $10
        33        SEND_VAR_EX                                              !1
        34        DO_FCALL                                      0  $11     
        35        ADD_ARRAY_UNPACK                                 ~3      $11
        36        QM_ASSIGN                                        ~12     ~3
        37      > JMP                                                      ->39
        38    >   QM_ASSIGN                                        ~12     !0
        39    > > RETURN                                                   ~12
        40*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJDGfH0x7f8c9167a013

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.68 ms | 416 KiB | 7 Q