3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [ 'id' => 1, 'total' => 100, ], [ 'id' => 2, 'total' => 200, ], [ 'id' => 1, 'total' => 300, ], ]; $array2 = [ [ 'id' => 1, 'daily' => 10, ], [ 'id' => 2, 'daily' => 20, ], ]; $result = array(); foreach($array1 as $key => $value){ $result[] = $array1[$key] + $array2[$key]; } print_r($result); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/vbCGo
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array1, !1 = $array2, !2 = $result, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   29     2        ASSIGN                                                   !2, <array>
   31     3      > FE_RESET_R                                       $8      !0, ->12
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->12
          5    >   ASSIGN                                                   !4, ~9
   32     6        FETCH_DIM_R                                      ~12     !0, !4
          7        FETCH_DIM_R                                      ~13     !1, !4
          8        ADD                                              ~14     ~12, ~13
          9        ASSIGN_DIM                                               !2
         10        OP_DATA                                                  ~14
   31    11      > JMP                                                      ->4
         12    >   FE_FREE                                                  $8
   35    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
   36    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.13 ms | 1399 KiB | 15 Q