3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [11 => 771725], [11 => 847226], [10 => 410035], [11 => 455387], ]; $result = array_fill_keys(range(1,12), 0); foreach ($array as $a) { $result[key($a)] += reset($a); } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/Tf1QZ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $result, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_fill_keys'
          2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 12
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 0
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
   11    10      > FE_RESET_R                                       $7      !0, ->21
         11    > > FE_FETCH_R                                               $7, !2, ->21
   12    12    >   INIT_FCALL                                               'key'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $8      
         15        INIT_FCALL                                               'reset'
         16        SEND_REF                                                 !2
         17        DO_ICALL                                         $10     
         18        ASSIGN_DIM_OP                +=               1          !1, $8
         19        OP_DATA                                                  $10
   11    20      > JMP                                                      ->11
         21    >   FE_FREE                                                  $7
   15    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.56 ms | 1004 KiB | 18 Q