3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ["partner_name" => "Liquid Education", "lead_payIn" => 44.00], ["partner_name" => "Yodel Voice", "lead_payIn" => 44.00], ["partner_name" => "Yodel Voice", "lead_payIn" => 44.00], ["partner_name" => "Yodel Voice", "lead_payIn" => 44.00], ["partner_name" => "Yodel Voice", "lead_payIn" => 44.00], ]; $result = []; foreach ($arr as $a) { array_key_exists( $a["partner_name"], $result ) ? $result[$a["partner_name"]] += $a["lead_payIn"] : $result[$a["partner_name"]] = $a["lead_payIn"]; } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/4ajJo
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $result, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_R                                       $5      !0, ->20
          3    > > FE_FETCH_R                                               $5, !2, ->20
   15     4    >   FETCH_DIM_R                                      ~6      !2, 'partner_name'
          5        ARRAY_KEY_EXISTS                                         ~6, !1
          6      > JMPZ                                                     ~7, ->13
   16     7    >   FETCH_DIM_R                                      ~8      !2, 'partner_name'
          8        FETCH_DIM_R                                      ~10     !2, 'lead_payIn'
          9        ASSIGN_DIM_OP                +=               1  ~9      !1, ~8
         10        OP_DATA                                                  ~10
         11        QM_ASSIGN                                        ~11     ~9
         12      > JMP                                                      ->18
         13    >   FETCH_DIM_R                                      ~12     !2, 'partner_name'
         14        FETCH_DIM_R                                      ~14     !2, 'lead_payIn'
         15        ASSIGN_DIM                                       ~13     !1, ~12
         16        OP_DATA                                                  ~14
         17        QM_ASSIGN                                        ~11     ~13
         18    >   FREE                                                     ~11
   13    19      > JMP                                                      ->3
         20    >   FE_FREE                                                  $5
   18    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.31 ms | 1011 KiB | 14 Q