3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.2 ms | 1000 KiB | 16 Q