3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [1,2,3,6,7,8,9,11,33,44,55,66,77,88,16,18], [17,52,38,666,79,8,9,15,33,44,55,66,76,88,16,18], [17,562,538,7666,579,688,9,15,933,44,55,660,76,808,106,108], ]; $count = count($array); $mins = []; $maxs = []; $avgs = []; foreach ($array as $i => $row) { foreach ($row as $col => $value) { $ch = $col + 1; if (!$i) { $mins[$ch] = $value; $maxs[$ch] = $value; $avgs[$ch] = $value; } else { if ($value < $mins[$ch]) { $mins[$ch] = $value; } if ($value > $maxs[$ch]) { $maxs[$ch] = $value; } $avgs[$ch] += $value; if ($i === $count - 1) { $avgs[$ch] = number_format($avgs[$ch] / $count, 2); } } } } echo '<table border=1>'; printf( '<tr><th>Channels</th><th>CH%s</th></tr>', implode('</th><th>CH', array_keys($avgs)) ); printf( '<tr><th>Average</th><td>%s</td></tr>', implode('</td><td>', $avgs) ); printf( '<tr><th>Max</th><th>%s</td></tr>', implode('</td><td>', $maxs) ); printf( '<tr><th>Min</th><td>%s</td></tr>', implode('</td><td>', $mins) ); echo '</table>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 49
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 49
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 47
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 47
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 46
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 46
Branch analysis from position: 33
Branch analysis from position: 28
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 47
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/GH3kZ
function name:  (null)
number of ops:  88
compiled vars:  !0 = $array, !1 = $count, !2 = $mins, !3 = $maxs, !4 = $avgs, !5 = $row, !6 = $i, !7 = $value, !8 = $col, !9 = $ch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        COUNT                                            ~11     !0
          2        ASSIGN                                                   !1, ~11
   10     3        ASSIGN                                                   !2, <array>
   11     4        ASSIGN                                                   !3, <array>
   12     5        ASSIGN                                                   !4, <array>
   13     6      > FE_RESET_R                                       $16     !0, ->49
          7    > > FE_FETCH_R                                       ~17     $16, !5, ->49
          8    >   ASSIGN                                                   !6, ~17
   14     9      > FE_RESET_R                                       $19     !5, ->47
         10    > > FE_FETCH_R                                       ~20     $19, !7, ->47
         11    >   ASSIGN                                                   !8, ~20
   15    12        ADD                                              ~22     !8, 1
         13        ASSIGN                                                   !9, ~22
   16    14        BOOL_NOT                                         ~24     !6
         15      > JMPZ                                                     ~24, ->23
   17    16    >   ASSIGN_DIM                                               !2, !9
         17        OP_DATA                                                  !7
   18    18        ASSIGN_DIM                                               !3, !9
         19        OP_DATA                                                  !7
   19    20        ASSIGN_DIM                                               !4, !9
         21        OP_DATA                                                  !7
         22      > JMP                                                      ->46
   21    23    >   FETCH_DIM_R                                      ~28     !2, !9
         24        IS_SMALLER                                               !7, ~28
         25      > JMPZ                                                     ~29, ->28
   22    26    >   ASSIGN_DIM                                               !2, !9
         27        OP_DATA                                                  !7
   24    28    >   FETCH_DIM_R                                      ~31     !3, !9
         29        IS_SMALLER                                               ~31, !7
         30      > JMPZ                                                     ~32, ->33
   25    31    >   ASSIGN_DIM                                               !3, !9
         32        OP_DATA                                                  !7
   27    33    >   ASSIGN_DIM_OP                +=               1          !4, !9
         34        OP_DATA                                                  !7
   28    35        SUB                                              ~35     !1, 1
         36        IS_IDENTICAL                                             !6, ~35
         37      > JMPZ                                                     ~36, ->46
   29    38    >   INIT_FCALL                                               'number_format'
         39        FETCH_DIM_R                                      ~38     !4, !9
         40        DIV                                              ~39     ~38, !1
         41        SEND_VAL                                                 ~39
         42        SEND_VAL                                                 2
         43        DO_ICALL                                         $40     
         44        ASSIGN_DIM                                               !4, !9
         45        OP_DATA                                                  $40
   14    46    > > JMP                                                      ->10
         47    >   FE_FREE                                                  $19
   13    48      > JMP                                                      ->7
         49    >   FE_FREE                                                  $16
   35    50        ECHO                                                     '%3Ctable+border%3D1%3E'
   36    51        INIT_FCALL                                               'printf'
   37    52        SEND_VAL                                                 '%3Ctr%3E%3Cth%3EChannels%3C%2Fth%3E%3Cth%3ECH%25s%3C%2Fth%3E%3C%2Ftr%3E'
   38    53        INIT_FCALL                                               'implode'
         54        SEND_VAL                                                 '%3C%2Fth%3E%3Cth%3ECH'
         55        INIT_FCALL                                               'array_keys'
         56        SEND_VAR                                                 !4
         57        DO_ICALL                                         $41     
         58        SEND_VAR                                                 $41
         59        DO_ICALL                                         $42     
         60        SEND_VAR                                                 $42
         61        DO_ICALL                                                 
   40    62        INIT_FCALL                                               'printf'
   41    63        SEND_VAL                                                 '%3Ctr%3E%3Cth%3EAverage%3C%2Fth%3E%3Ctd%3E%25s%3C%2Ftd%3E%3C%2Ftr%3E'
   42    64        INIT_FCALL                                               'implode'
         65        SEND_VAL                                                 '%3C%2Ftd%3E%3Ctd%3E'
         66        SEND_VAR                                                 !4
         67        DO_ICALL                                         $44     
         68        SEND_VAR                                                 $44
         69        DO_ICALL                                                 
   44    70        INIT_FCALL                                               'printf'
   45    71        SEND_VAL                                                 '%3Ctr%3E%3Cth%3EMax%3C%2Fth%3E%3Cth%3E%25s%3C%2Ftd%3E%3C%2Ftr%3E'
   46    72        INIT_FCALL                                               'implode'
         73        SEND_VAL                                                 '%3C%2Ftd%3E%3Ctd%3E'
         74        SEND_VAR                                                 !3
         75        DO_ICALL                                         $46     
         76        SEND_VAR                                                 $46
         77        DO_ICALL                                                 
   48    78        INIT_FCALL                                               'printf'
   49    79        SEND_VAL                                                 '%3Ctr%3E%3Cth%3EMin%3C%2Fth%3E%3Ctd%3E%25s%3C%2Ftd%3E%3C%2Ftr%3E'
   50    80        INIT_FCALL                                               'implode'
         81        SEND_VAL                                                 '%3C%2Ftd%3E%3Ctd%3E'
         82        SEND_VAR                                                 !2
         83        DO_ICALL                                         $48     
         84        SEND_VAR                                                 $48
         85        DO_ICALL                                                 
   52    86        ECHO                                                     '%3C%2Ftable%3E'
         87      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.19 ms | 1409 KiB | 21 Q