3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]; $array = array_map(function(array $chunk): float { return array_sum($chunk) / count($chunk); }, array_chunk($array, 5)); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qi7a9
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    6     3        SEND_VAL                                                 ~2
          4        INIT_FCALL                                               'array_chunk'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 5
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
    4     9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !0, $4
    8    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qi7a9
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $chunk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'array_sum'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        COUNT                                            ~2      !0
          5        DIV                                              ~3      $1, ~2
          6        VERIFY_RETURN_TYPE                                       ~3
          7      > RETURN                                                   ~3
    6     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.47 ms | 1005 KiB | 17 Q