3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array(); $array1 = array(array("a" => 30, "b" => 5), array("a" => 30, "b" => 5), array("a" => 30, "b" => 0), array("a" => 5, "b" => 5), array("a" => 15, "b" => 0)); $array2 = array(array("a" => 207, "b" => 225), array("a" => 35, "b" => 0), array("a" => 35, "b" => 90), array("a" => 80, "b" => 140), array("a" => 40, "b" => 35)); $array3 = Array(); reset($array1); while (list($key) = each($array1)) { reset($array1[$key]); while (list($k,$v) = each($array1[$key])) { $array3[$key][$k] = $v + $array2[$key][$k]; } } print_r($array3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 8
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 13
Branch analysis from position: 29
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 13
Branch analysis from position: 29
Branch analysis from position: 13
filename:       /in/dIPa8
function name:  (null)
number of ops:  39
compiled vars:  !0 = $result, !1 = $array1, !2 = $array2, !3 = $array3, !4 = $key, !5 = $k, !6 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    7     3        ASSIGN                                                   !3, <array>
    8     4        INIT_FCALL                                               'reset'
          5        SEND_REF                                                 !1
          6        DO_ICALL                                                 
    9     7      > JMP                                                      ->29
   10     8    >   INIT_FCALL                                               'reset'
          9        FETCH_DIM_W                                      $12     !1, !4
         10        SEND_REF                                                 $12
         11        DO_ICALL                                                 
   11    12      > JMP                                                      ->19
   12    13    >   FETCH_DIM_R                                      ~16     !2, !4
         14        FETCH_DIM_R                                      ~17     ~16, !5
         15        ADD                                              ~18     !6, ~17
         16        FETCH_DIM_W                                      $14     !3, !4
         17        ASSIGN_DIM                                               $14, !5
         18        OP_DATA                                                  ~18
   11    19    >   INIT_FCALL_BY_NAME                                       'each'
         20        CHECK_FUNC_ARG                                           
         21        FETCH_DIM_FUNC_ARG                               $19     !1, !4
         22        SEND_FUNC_ARG                                            $19
         23        DO_FCALL                                      0  $20     
         24        FETCH_LIST_R                                     $21     $20, 0
         25        ASSIGN                                                   !5, $21
         26        FETCH_LIST_R                                     $23     $20, 1
         27        ASSIGN                                                   !6, $23
         28      > JMPNZ                                                    $20, ->13
    9    29    >   INIT_FCALL_BY_NAME                                       'each'
         30        SEND_VAR_EX                                              !1
         31        DO_FCALL                                      0  $25     
         32        FETCH_LIST_R                                     $26     $25, 0
         33        ASSIGN                                                   !4, $26
         34      > JMPNZ                                                    $25, ->8
   16    35    >   INIT_FCALL                                               'print_r'
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.41 ms | 1400 KiB | 20 Q