3v4l.org

run code in 300+ PHP versions simultaneously
<?php $interval1_start = 60 * 60 * 8; // 8am $interval1_end = 60 * 60 * 12 -1; // 11:59:59am $interval2_start = 60 * 60 * 12; // 12pm $interval2_end = 60 * 60 * 16 -1; // 15:59:59pm $interval3_start = 60 * 60 * 15; // 15pm $interval3_end = 60 * 60 * 20 -1; // 15:59:59pm $init_time = strtotime(date('Y-m-d')); $cur_time = time(); $diff = $cur_time - $init_time; if ($diff >= $interval1_start && $diff <= $interval1_end) { echo 'code 1'; } elseif ($diff >= $interval2_start && $diff <= $interval2_end) { echo 'code 2'; } elseif ($diff >= $interval3_start && $diff <= $interval3_end) { echo 'code 3'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 32
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 38
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 36
Branch analysis from position: 29
Branch analysis from position: 22
filename:       /in/o9uOr
function name:  (null)
number of ops:  39
compiled vars:  !0 = $interval1_start, !1 = $interval1_end, !2 = $interval2_start, !3 = $interval2_end, !4 = $interval3_start, !5 = $interval3_end, !6 = $init_time, !7 = $cur_time, !8 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 28800
    4     1        ASSIGN                                                   !1, 43199
    5     2        ASSIGN                                                   !2, 43200
    6     3        ASSIGN                                                   !3, 57599
    7     4        ASSIGN                                                   !4, 54000
    8     5        ASSIGN                                                   !5, 71999
   10     6        INIT_FCALL                                               'strtotime'
          7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d'
          9        DO_ICALL                                         $15     
         10        SEND_VAR                                                 $15
         11        DO_ICALL                                         $16     
         12        ASSIGN                                                   !6, $16
   11    13        INIT_FCALL                                               'time'
         14        DO_ICALL                                         $18     
         15        ASSIGN                                                   !7, $18
   13    16        SUB                                              ~20     !7, !6
         17        ASSIGN                                                   !8, ~20
   15    18        IS_SMALLER_OR_EQUAL                              ~22     !0, !8
         19      > JMPZ_EX                                          ~22     ~22, ->22
         20    >   IS_SMALLER_OR_EQUAL                              ~23     !8, !1
         21        BOOL                                             ~22     ~23
         22    > > JMPZ                                                     ~22, ->25
   16    23    >   ECHO                                                     'code+1'
         24      > JMP                                                      ->38
   18    25    >   IS_SMALLER_OR_EQUAL                              ~24     !2, !8
         26      > JMPZ_EX                                          ~24     ~24, ->29
         27    >   IS_SMALLER_OR_EQUAL                              ~25     !8, !3
         28        BOOL                                             ~24     ~25
         29    > > JMPZ                                                     ~24, ->32
   19    30    >   ECHO                                                     'code+2'
         31      > JMP                                                      ->38
   21    32    >   IS_SMALLER_OR_EQUAL                              ~26     !4, !8
         33      > JMPZ_EX                                          ~26     ~26, ->36
         34    >   IS_SMALLER_OR_EQUAL                              ~27     !8, !5
         35        BOOL                                             ~26     ~27
         36    > > JMPZ                                                     ~26, ->38
   22    37    >   ECHO                                                     'code+3'
   23    38    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.48 ms | 1400 KiB | 19 Q