3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $arr = [["url_id" => 2191238, "time_spent" => 41], ["url_id" => 2191606, "time_spent" => 215], ["url_id" => 2191606, "time_spent" => 25] ]; $its_by_url = array(); foreach($arr as $data) { $its_by_url[ $data["url_id"] ] = 0; } foreach($arr as $data) { $its_by_url[ $data["url_id"] ] += $data["time_spent"]; } print_r($its_by_url);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 11
filename:       /in/mpAUm
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $its_by_url, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, <array>
    9     4        ASSIGN                                                   !1, <array>
   11     5      > FE_RESET_R                                       $6      !0, ->11
          6    > > FE_FETCH_R                                               $6, !2, ->11
   12     7    >   FETCH_DIM_R                                      ~7      !2, 'url_id'
          8        ASSIGN_DIM                                               !1, ~7
          9        OP_DATA                                                  0
   11    10      > JMP                                                      ->6
         11    >   FE_FREE                                                  $6
   15    12      > FE_RESET_R                                       $9      !0, ->19
         13    > > FE_FETCH_R                                               $9, !2, ->19
   16    14    >   FETCH_DIM_R                                      ~10     !2, 'url_id'
         15        FETCH_DIM_R                                      ~12     !2, 'time_spent'
         16        ASSIGN_DIM_OP                +=               1          !1, ~10
         17        OP_DATA                                                  ~12
   15    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $9
   19    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.49 ms | 1007 KiB | 15 Q