3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array(); $arrayOne = 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)); $arrayTwo = 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)); foreach($arrayOne as $key => $value) { $result[] = array( "a" => $value["a"] + $arrayTwo[$key]["a"], "b" => $value["b"] + $arrayTwo[$key]["b"] ); } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/TCMnl
function name:  (null)
number of ops:  24
compiled vars:  !0 = $result, !1 = $arrayOne, !2 = $arrayTwo, !3 = $value, !4 = $key
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      > FE_RESET_R                                       $8      !1, ->19
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->19
          5    >   ASSIGN                                                   !4, ~9
   10     6        FETCH_DIM_R                                      ~12     !3, 'a'
          7        FETCH_DIM_R                                      ~13     !2, !4
          8        FETCH_DIM_R                                      ~14     ~13, 'a'
          9        ADD                                              ~15     ~12, ~14
         10        INIT_ARRAY                                       ~16     ~15, 'a'
   11    11        FETCH_DIM_R                                      ~17     !3, 'b'
         12        FETCH_DIM_R                                      ~18     !2, !4
         13        FETCH_DIM_R                                      ~19     ~18, 'b'
         14        ADD                                              ~20     ~17, ~19
         15        ADD_ARRAY_ELEMENT                                ~16     ~20, 'b'
    9    16        ASSIGN_DIM                                               !0
   11    17        OP_DATA                                                  ~16
    7    18      > JMP                                                      ->4
         19    >   FE_FREE                                                  $8
   15    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.16 ms | 1395 KiB | 15 Q