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; echo $diff; 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 = 21, Position 2 = 23
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 37
Branch analysis from position: 30
Branch analysis from position: 23
filename:       /in/B4icb
function name:  (null)
number of ops:  40
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
   14    18        ECHO                                                     !8
   16    19        IS_SMALLER_OR_EQUAL                              ~22     !0, !8
         20      > JMPZ_EX                                          ~22     ~22, ->23
         21    >   IS_SMALLER_OR_EQUAL                              ~23     !8, !1
         22        BOOL                                             ~22     ~23
         23    > > JMPZ                                                     ~22, ->26
   17    24    >   ECHO                                                     'code+1'
         25      > JMP                                                      ->39
   19    26    >   IS_SMALLER_OR_EQUAL                              ~24     !2, !8
         27      > JMPZ_EX                                          ~24     ~24, ->30
         28    >   IS_SMALLER_OR_EQUAL                              ~25     !8, !3
         29        BOOL                                             ~24     ~25
         30    > > JMPZ                                                     ~24, ->33
   20    31    >   ECHO                                                     'code+2'
         32      > JMP                                                      ->39
   22    33    >   IS_SMALLER_OR_EQUAL                              ~26     !4, !8
         34      > JMPZ_EX                                          ~26     ~26, ->37
         35    >   IS_SMALLER_OR_EQUAL                              ~27     !8, !5
         36        BOOL                                             ~26     ~27
         37    > > JMPZ                                                     ~26, ->39
   23    38    >   ECHO                                                     'code+3'
   24    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.89 ms | 1400 KiB | 19 Q