3v4l.org

run code in 500+ PHP versions simultaneously
<?php $all_arrays = [ array(0, 7, 5, 0), array(2, 6, 10, 0), array(4, 8, 15, 10), array(6, 7, 20, 10), array(1, 2, 3, 4), array(5, 6, 7, 8), // more arrays ]; $each_array_count = count($all_arrays[0]); // 4 $all_arrays_count = count($all_arrays); // 6 $output = []; for ($i = 0; $i < $each_array_count; $i++) { for ($j=0; $j < $all_arrays_count; $j++) { $output[$i] += $all_arrays[$j][$i] / $all_arrays_count; } } echo "<pre>"; var_dump($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 11
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
Branch analysis from position: 9
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 11
Branch analysis from position: 19
Branch analysis from position: 11
filename:       /in/E783F
function name:  (null)
number of ops:  27
compiled vars:  !0 = $all_arrays, !1 = $each_array_count, !2 = $all_arrays_count, !3 = $output, !4 = $i, !5 = $j
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   13     1        FETCH_DIM_R                                          ~7      !0, 0
          2        COUNT                                                ~8      ~7
          3        ASSIGN                                                       !1, ~8
   14     4        COUNT                                                ~10     !0
          5        ASSIGN                                                       !2, ~10
   16     6        ASSIGN                                                       !3, <array>
   18     7        ASSIGN                                                       !4, 0
          8      > JMP                                                          ->20
   19     9    >   ASSIGN                                                       !5, 0
         10      > JMP                                                          ->17
   20    11    >   FETCH_DIM_R                                          ~16     !0, !5
         12        FETCH_DIM_R                                          ~17     ~16, !4
         13        DIV                                                  ~18     ~17, !2
         14        ASSIGN_DIM_OP                    +=               1          !3, !4
         15        OP_DATA                                                      ~18
   19    16        PRE_INC                                                      !5
         17    >   IS_SMALLER                                                   !5, !2
         18      > JMPNZ                                                        ~20, ->11
   18    19    >   PRE_INC                                                      !4
         20    >   IS_SMALLER                                                   !4, !1
         21      > JMPNZ                                                        ~22, ->9
   24    22    >   ECHO                                                         '%3Cpre%3E'
   25    23        INIT_FCALL                                                   'var_dump'
         24        SEND_VAR                                                     !3
         25        DO_ICALL                                                     
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.26 ms | 1915 KiB | 14 Q