3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [1,2,3,4,5]; $arr2 = [5,2,4,1]; $arr3 = [2,1,2,2]; $arr4 = [2,1,2,2]; $arr5 = [2,1,2,2,6,1,3,2]; $arr6 = [1,2,3]; $all = []; $i=1; $count = Null; while(isset(${"arr" . $i})){ $all[] = ${"arr" . $i}; if(count(${"arr" . $i}) > $count){ $count = count(${"arr" . $i}); $longkey = $i-1; } $i++; } foreach($all[$longkey] as $key => $v){ $result[$key] = array_sum(array_column($all, $key)); } var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 10
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 43
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 43
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 10
Branch analysis from position: 29
Branch analysis from position: 10
Branch analysis from position: 25
filename:       /in/lIVGo
function name:  (null)
number of ops:  48
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $arr3, !3 = $arr4, !4 = $arr5, !5 = $arr6, !6 = $all, !7 = $i, !8 = $count, !9 = $longkey, !10 = $v, !11 = $key, !12 = $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>
    6     3        ASSIGN                                                   !3, <array>
    7     4        ASSIGN                                                   !4, <array>
    8     5        ASSIGN                                                   !5, <array>
    9     6        ASSIGN                                                   !6, <array>
   11     7        ASSIGN                                                   !7, 1
   12     8        ASSIGN                                                   !8, null
   13     9      > JMP                                                      ->26
   14    10    >   CONCAT                                           ~23     'arr', !7
         11        FETCH_R                      local               ~24     ~23
         12        ASSIGN_DIM                                               !6
         13        OP_DATA                                                  ~24
   15    14        CONCAT                                           ~25     'arr', !7
         15        FETCH_R                      local               ~26     ~25
         16        COUNT                                            ~27     ~26
         17        IS_SMALLER                                               !8, ~27
         18      > JMPZ                                                     ~28, ->25
   16    19    >   CONCAT                                           ~29     'arr', !7
         20        FETCH_R                      local               ~30     ~29
         21        COUNT                                            ~31     ~30
         22        ASSIGN                                                   !8, ~31
   17    23        SUB                                              ~33     !7, 1
         24        ASSIGN                                                   !9, ~33
   19    25    >   PRE_INC                                                  !7
   13    26    >   CONCAT                                           ~36     'arr', !7
         27        ISSET_ISEMPTY_VAR                             4          ~36
         28      > JMPNZ                                                    ~37, ->10
   25    29    >   FETCH_DIM_R                                      ~38     !6, !9
         30      > FE_RESET_R                                       $39     ~38, ->43
         31    > > FE_FETCH_R                                       ~40     $39, !10, ->43
         32    >   ASSIGN                                                   !11, ~40
   26    33        INIT_FCALL                                               'array_sum'
         34        INIT_FCALL                                               'array_column'
         35        SEND_VAR                                                 !6
         36        SEND_VAR                                                 !11
         37        DO_ICALL                                         $43     
         38        SEND_VAR                                                 $43
         39        DO_ICALL                                         $44     
         40        ASSIGN_DIM                                               !12, !11
         41        OP_DATA                                                  $44
   25    42      > JMP                                                      ->31
         43    >   FE_FREE                                                  $39
   29    44        INIT_FCALL                                               'var_dump'
         45        SEND_VAR                                                 !12
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.26 ms | 1005 KiB | 16 Q