3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [1, 2, 2, 3]; $array2 = [10, 20, 30, 50]; $array_sum1 = []; foreach ($array1 as $key => $value) { $array_sum1[$value][] = $array2[$key]; } $array_sum1 = array_map("array_sum", $array_sum1); print_r($array_sum1); $array3 = [4, 4, 4, 6]; $array4 = [10, 20, 30, 50]; $array_sum2 = []; foreach ($array3 as $key => $value) { $array_sum2[$value][] = $array4[$key]; } $array_sum2 = array_map("array_sum", $array_sum2); print_r($array_sum2);die;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 31
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 11
filename:       /in/5sXjt
function name:  (null)
number of ops:  42
compiled vars:  !0 = $array1, !1 = $array2, !2 = $array_sum1, !3 = $value, !4 = $key, !5 = $array3, !6 = $array4, !7 = $array_sum2
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>
    6     3      > FE_RESET_R                                       $11     !0, ->11
          4    > > FE_FETCH_R                                       ~12     $11, !3, ->11
          5    >   ASSIGN                                                   !4, ~12
    7     6        FETCH_DIM_R                                      ~16     !1, !4
          7        FETCH_DIM_W                                      $14     !2, !3
          8        ASSIGN_DIM                                               $14
          9        OP_DATA                                                  ~16
    6    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $11
    9    12        INIT_FCALL                                               'array_map'
         13        SEND_VAL                                                 'array_sum'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $17     
         16        ASSIGN                                                   !2, $17
   10    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   11    20        ASSIGN                                                   !5, <array>
   12    21        ASSIGN                                                   !6, <array>
   13    22        ASSIGN                                                   !7, <array>
   14    23      > FE_RESET_R                                       $23     !5, ->31
         24    > > FE_FETCH_R                                       ~24     $23, !3, ->31
         25    >   ASSIGN                                                   !4, ~24
   15    26        FETCH_DIM_R                                      ~28     !6, !4
         27        FETCH_DIM_W                                      $26     !7, !3
         28        ASSIGN_DIM                                               $26
         29        OP_DATA                                                  ~28
   14    30      > JMP                                                      ->24
         31    >   FE_FREE                                                  $23
   17    32        INIT_FCALL                                               'array_map'
         33        SEND_VAL                                                 'array_sum'
         34        SEND_VAR                                                 !7
         35        DO_ICALL                                         $29     
         36        ASSIGN                                                   !7, $29
   18    37        INIT_FCALL                                               'print_r'
         38        SEND_VAR                                                 !7
         39        DO_ICALL                                                 
         40      > EXIT                                                     
   19    41*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.81 ms | 1008 KiB | 15 Q