3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Todaysales = array( array("sale_time"=>"2017-09-10","payment_amount"=>1311.45), array("sale_time"=>"2017-09-10","payment_amount"=>1311.46), array("sale_time"=>"2017-09-10","payment_amount"=>175000.00), ); foreach($Todaysales as $d) { if(isset($data[$d['sale_time']])) $data[$d['sale_time']] += $d['payment_amount']; else $data[$d['sale_time']] = $d['payment_amount']; } print_r($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
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: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/6TgNO
function name:  (null)
number of ops:  21
compiled vars:  !0 = $Todaysales, !1 = $d, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1      > FE_RESET_R                                       $4      !0, ->16
          2    > > FE_FETCH_R                                               $4, !1, ->16
   11     3    >   FETCH_DIM_R                                      ~5      !1, 'sale_time'
          4        ISSET_ISEMPTY_DIM_OBJ                         0          !2, ~5
          5      > JMPZ                                                     ~6, ->11
   12     6    >   FETCH_DIM_R                                      ~7      !1, 'sale_time'
          7        FETCH_DIM_R                                      ~9      !1, 'payment_amount'
          8        ASSIGN_DIM_OP                +=               1          !2, ~7
          9        OP_DATA                                                  ~9
   11    10      > JMP                                                      ->15
   14    11    >   FETCH_DIM_R                                      ~10     !1, 'sale_time'
         12        FETCH_DIM_R                                      ~12     !1, 'payment_amount'
         13        ASSIGN_DIM                                               !2, ~10
         14        OP_DATA                                                  ~12
    7    15    > > JMP                                                      ->2
         16    >   FE_FREE                                                  $4
   17    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.92 ms | 1436 KiB | 14 Q