3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 0 => Array ( 0 => Array ( 0 => 'R421_FD03', 1 => 1 ), 1 => Array ( 0 => 'R421_FD03', 1 => 1 ) ), 1 => Array ( 0 => Array ( 0 => 'R421_FD03', 1 => 1 ), 1 => Array ( 0 => 'R421_FD02', 1 => 1 ) ) ); $final_array = []; foreach($array as $arr){ foreach($arr as $ar){ $final_array[$ar[0]][0] = $ar[0]; $final_array[$ar[0]][1] = (isset($final_array[$ar[0]][1])) ? $final_array[$ar[0]][1] + $ar[1] : $ar[1]; } } $final_array = array_values($final_array); print_r($final_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 31
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 31
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 29
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 29
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/lABWG
function name:  (null)
number of ops:  40
compiled vars:  !0 = $array, !1 = $final_array, !2 = $arr, !3 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   39     1        ASSIGN                                                   !1, <array>
   41     2      > FE_RESET_R                                       $6      !0, ->31
          3    > > FE_FETCH_R                                               $6, !2, ->31
   42     4    > > FE_RESET_R                                       $7      !2, ->29
          5    > > FE_FETCH_R                                               $7, !3, ->29
   43     6    >   FETCH_DIM_R                                      ~8      !3, 0
          7        FETCH_DIM_R                                      ~11     !3, 0
          8        FETCH_DIM_W                                      $9      !1, ~8
          9        ASSIGN_DIM                                               $9, 0
         10        OP_DATA                                                  ~11
   44    11        FETCH_DIM_R                                      ~12     !3, 0
         12        FETCH_DIM_R                                      ~15     !3, 0
         13        FETCH_DIM_IS                                     ~16     !1, ~15
         14        ISSET_ISEMPTY_DIM_OBJ                         0          ~16, 1
         15      > JMPZ                                                     ~17, ->23
         16    >   FETCH_DIM_R                                      ~18     !3, 0
         17        FETCH_DIM_R                                      ~19     !1, ~18
         18        FETCH_DIM_R                                      ~20     ~19, 1
         19        FETCH_DIM_R                                      ~21     !3, 1
         20        ADD                                              ~22     ~20, ~21
         21        QM_ASSIGN                                        ~23     ~22
         22      > JMP                                                      ->25
         23    >   FETCH_DIM_R                                      ~24     !3, 1
         24        QM_ASSIGN                                        ~23     ~24
         25    >   FETCH_DIM_W                                      $13     !1, ~12
         26        ASSIGN_DIM                                               $13, 1
         27        OP_DATA                                                  ~23
   42    28      > JMP                                                      ->5
         29    >   FE_FREE                                                  $7
   41    30      > JMP                                                      ->3
         31    >   FE_FREE                                                  $6
   49    32        INIT_FCALL                                               'array_values'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $25     
         35        ASSIGN                                                   !1, $25
   50    36        INIT_FCALL                                               'print_r'
         37        SEND_VAR                                                 !1
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.9 ms | 991 KiB | 15 Q