3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array( 0 => array( 11 => 18.000, 14 => 25.100, 15 => 5.000, 16 => 8.000, 19 => 21.600 ), 1 => array( 11 => 9.100, 12 => 2.700, 14 => 2.300, 15 => 18.800, 16 => 9.500, 17 => 6.900, 19 => 9.400 ), 2 => array( 14 => 5.700 ), 3 => array( 17 => 2.800, 20 => 6.000 ), 4 => array( 24 => 5.000, 25 => 6.000, 26 => 2.7 ), 5 => array( 16 => 2.200 ), 6 => array( 14 => 13.000, 15 => 2.000, 16 => 4.300, 19 => 6.000 ), 7 => array( 32 => 5.000, 36 => 18.500 ) ); foreach($array as $subarray){ foreach($subarray as $k=>$v){ if(!isset($result[$k])){ $result[$k]=$v; }else{ $result[$k]+=$v; } } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/lBSn4
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $subarray, !2 = $v, !3 = $k, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   45     1      > FE_RESET_R                                       $6      !0, ->17
          2    > > FE_FETCH_R                                               $6, !1, ->17
   46     3    > > FE_RESET_R                                       $7      !1, ->15
          4    > > FE_FETCH_R                                       ~8      $7, !2, ->15
          5    >   ASSIGN                                                   !3, ~8
   47     6        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !4, !3
          7        BOOL_NOT                                         ~11     ~10
          8      > JMPZ                                                     ~11, ->12
   48     9    >   ASSIGN_DIM                                               !4, !3
         10        OP_DATA                                                  !2
         11      > JMP                                                      ->14
   50    12    >   ASSIGN_DIM_OP                +=               1          !4, !3
         13        OP_DATA                                                  !2
   46    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $7
   45    16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $6
   54    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.71 ms | 1401 KiB | 15 Q