3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 1 => [ 1 => 4, 5 => 7 ], 2 => [ 1 => 2, 5 => 5 ], 3 => [ 1 => 2, 5 => 5 ], 4 => [ 1 => 6, 5 => 9 ], 5 => [ 1 => 6, 5 => 8 ] ]; $sum = array_reduce($arr, function($carry, $item){ $carry += $item[5]; return $carry; }); echo $sum;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUQNK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $arr, !1 = $sum
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   25     1        INIT_FCALL                                                   'array_reduce'
          2        SEND_VAR                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   28     4        SEND_VAL                                                     ~3
   25     5        DO_ICALL                                             $4      
          6        ASSIGN                                                       !1, $4
   29     7        ECHO                                                         !1
          8      > 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/AUQNK
function name:  {closure:/in/AUQNK:25}
number of ops:  6
compiled vars:  !0 = $carry, !1 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   26     2        FETCH_DIM_R                                          ~2      !1, 5
          3        ASSIGN_OP                                         1          !0, ~2
   27     4      > RETURN                                                       !0
   28     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
198.08 ms | 2033 KiB | 14 Q