3v4l.org

run code in 300+ PHP versions simultaneously
<?php // How many times per day, get from DB $userInput = 17; $SecondsPerDay = 60 * 60 * 24; $Frequency = (int) ($SecondsPerDay / $userInput) -1; $midnight = strtotime('today midnight'); // Get an array of times to execute $executeTimes = array(); for($time=$midnight; $time<=($midnight+$SecondsPerDay); $time+=$Frequency) $executeTimes[] = date("g:i a", $time); print_r($executeTimes);
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 = 23, Position 2 = 13
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 13
Branch analysis from position: 23
Branch analysis from position: 13
filename:       /in/0PCXh
function name:  (null)
number of ops:  27
compiled vars:  !0 = $userInput, !1 = $SecondsPerDay, !2 = $Frequency, !3 = $midnight, !4 = $executeTimes, !5 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 17
    6     1        ASSIGN                                                   !1, 86400
    8     2        DIV                                              ~8      !1, !0
          3        CAST                                          4  ~9      ~8
          4        SUB                                              ~10     ~9, 1
          5        ASSIGN                                                   !2, ~10
   10     6        INIT_FCALL                                               'strtotime'
          7        SEND_VAL                                                 'today+midnight'
          8        DO_ICALL                                         $12     
          9        ASSIGN                                                   !3, $12
   13    10        ASSIGN                                                   !4, <array>
   14    11        ASSIGN                                                   !5, !3
         12      > JMP                                                      ->20
   15    13    >   INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'g%3Ai+a'
         15        SEND_VAR                                                 !5
         16        DO_ICALL                                         $17     
         17        ASSIGN_DIM                                               !4
         18        OP_DATA                                                  $17
   14    19        ASSIGN_OP                                     1          !5, !2
         20    >   ADD                                              ~19     !3, !1
         21        IS_SMALLER_OR_EQUAL                                      !5, ~19
         22      > JMPNZ                                                    ~20, ->13
   17    23    >   INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.96 ms | 1000 KiB | 16 Q