3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ["Plat" => "hello", "Data" => "01/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "01/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ]; foreach ($array as $row) { if (!isset($result[$row['Data']])) { $result[$row['Data']] = $row; } else { $result[$row['Data']]['Quan'] += $row['Quan']; } } $result = array_values($result); 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 = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/MeAVA
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $row, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   11     1      > FE_RESET_R                                           $4      !0, ->17
          2    > > FE_FETCH_R                                                   $4, !1, ->17
   12     3    >   FETCH_DIM_R                                          ~5      !1, 'Data'
          4        ISSET_ISEMPTY_DIM_OBJ                             0  ~6      !2, ~5
          5        BOOL_NOT                                             ~7      ~6
          6      > JMPZ                                                         ~7, ->11
   13     7    >   FETCH_DIM_R                                          ~8      !1, 'Data'
          8        ASSIGN_DIM                                                   !2, ~8
          9        OP_DATA                                                      !1
   12    10      > JMP                                                          ->16
   15    11    >   FETCH_DIM_R                                          ~10     !1, 'Data'
         12        FETCH_DIM_R                                          ~13     !1, 'Quan'
         13        FETCH_DIM_RW                                         $11     !2, ~10
         14        ASSIGN_DIM_OP                    +=               1          $11, 'Quan'
         15        OP_DATA                                                      ~13
   11    16    > > JMP                                                          ->2
         17    >   FE_FREE                                                      $4
   18    18        INIT_FCALL                                                   'array_values'
         19        SEND_VAR                                                     !2
         20        DO_ICALL                                             $14     
         21        ASSIGN                                                       !2, $14
   19    22        INIT_FCALL                                                   'var_export'
         23        SEND_VAR                                                     !2
         24        DO_ICALL                                                     
         25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.92 ms | 2066 KiB | 15 Q