3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array_1 = Array (4, 6, 2, 6, 4, 10, 4, 6, 2, 2, 4, 4, 2, 2 ); $array_2 = Array ("DK","GA","DK","GA","DK","GA","WE","VE","WE","VE","PLA","PRA","PLA","PRA" ) ; Foreach($array_2 as $key => $val){ If(!isset($new[$val])) $new[$val] =0; $new[$val] += $array_1[$key]; } Var_dump($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/jOR7Z
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array_1, !1 = $array_2, !2 = $val, !3 = $key, !4 = $new
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        ASSIGN                                                       !1, <array>
    8     2      > FE_RESET_R                                           $7      !1, ->14
          3    > > FE_FETCH_R                                           ~8      $7, !2, ->14
          4    >   ASSIGN                                                       !3, ~8
    9     5        ISSET_ISEMPTY_DIM_OBJ                             0  ~10     !4, !2
          6        BOOL_NOT                                             ~11     ~10
          7      > JMPZ                                                         ~11, ->10
          8    >   ASSIGN_DIM                                                   !4, !2
          9        OP_DATA                                                      0
   10    10    >   FETCH_DIM_R                                          ~14     !0, !3
         11        ASSIGN_DIM_OP                    +=               1          !4, !2
         12        OP_DATA                                                      ~14
    8    13      > JMP                                                          ->3
         14    >   FE_FREE                                                      $7
   12    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !4
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.58 ms | 2044 KiB | 14 Q