3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FAUQNK%3A25%240'
   28     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
   25     6        ASSIGN                                                   !1, $4
   29     7        ECHO                                                     !1
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAUQNK%3A25%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUQNK
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FAUQNK%3A25%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
124.13 ms | 1399 KiB | 15 Q