3v4l.org

run code in 500+ PHP versions simultaneously
<?php $existing = []; $win_numbers = []; for ($rnd=1;$rnd<=250;$rnd++) { $randoms[] = mt_rand(0,36); // see this block for generating randoms } echo "Random Numbers:<br>\n"; echo implode('-', $randoms).PHP_EOL; echo "<br><br>\n\n"; $i = 0; for($i=0;$i<count($randoms)-4;$i++){ //echo $randoms[$i] . "\n"; $avg[] = array_sum(array_slice($randoms, $i, 5))/5; } //echo "Win Numbers:<br>"; //echo implode('-',$win_numbers); //echo "<br><br>"; echo "Moving Averages:<br>\n"; echo implode("-", $avg);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 21
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 21
Branch analysis from position: 37
Branch analysis from position: 21
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/XUdlP
function name:  (null)
number of ops:  41
compiled vars:  !0 = $existing, !1 = $win_numbers, !2 = $rnd, !3 = $randoms, !4 = $i, !5 = $avg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    5     2        ASSIGN                                                       !2, 1
          3      > JMP                                                          ->11
    7     4    >   INIT_FCALL                                                   'mt_rand'
          5        SEND_VAL                                                     0
          6        SEND_VAL                                                     36
          7        DO_ICALL                                             $10     
          8        ASSIGN_DIM                                                   !3
          9        OP_DATA                                                      $10
    5    10        PRE_INC                                                      !2
         11    >   IS_SMALLER_OR_EQUAL                                          !2, 250
         12      > JMPNZ                                                        ~12, ->4
   10    13    >   ECHO                                                         'Random+Numbers%3A%3Cbr%3E%0A'
   11    14        FRAMELESS_ICALL_2                implode             ~13     '-', !3
         15        CONCAT                                               ~14     ~13, '%0A'
         16        ECHO                                                         ~14
   13    17        ECHO                                                         '%3Cbr%3E%3Cbr%3E%0A%0A'
   15    18        ASSIGN                                                       !4, 0
   16    19        ASSIGN                                                       !4, 0
         20      > JMP                                                          ->33
   18    21    >   INIT_FCALL                                                   'array_sum'
         22        INIT_FCALL                                                   'array_slice'
         23        SEND_VAR                                                     !3
         24        SEND_VAR                                                     !4
         25        SEND_VAL                                                     5
         26        DO_ICALL                                             $18     
         27        SEND_VAR                                                     $18
         28        DO_ICALL                                             $19     
         29        DIV                                                  ~20     $19, 5
         30        ASSIGN_DIM                                                   !5
         31        OP_DATA                                                      ~20
   16    32        PRE_INC                                                      !4
         33    >   COUNT                                                ~22     !3
         34        SUB                                                  ~23     ~22, 4
         35        IS_SMALLER                                                   !4, ~23
         36      > JMPNZ                                                        ~24, ->21
   26    37    >   ECHO                                                         'Moving+Averages%3A%3Cbr%3E%0A'
   27    38        FRAMELESS_ICALL_2                implode             ~25     '-', !5
         39        ECHO                                                         ~25
         40      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.78 ms | 2468 KiB | 16 Q