3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Paris'); $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(); echo $cur_time . ' / ' . $init_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 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 38
2 jumps found. (Code = 46) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 42
Branch analysis from position: 35
Branch analysis from position: 28
filename:       /in/iJhj9
function name:  (null)
number of ops:  45
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 >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FParis'
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, 28800
    6     4        ASSIGN                                                   !1, 43199
    7     5        ASSIGN                                                   !2, 43200
    8     6        ASSIGN                                                   !3, 57599
    9     7        ASSIGN                                                   !4, 54000
   10     8        ASSIGN                                                   !5, 71999
   12     9        INIT_FCALL                                               'strtotime'
         10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'Y-m-d'
         12        DO_ICALL                                         $16     
         13        SEND_VAR                                                 $16
         14        DO_ICALL                                         $17     
         15        ASSIGN                                                   !6, $17
   13    16        INIT_FCALL                                               'time'
         17        DO_ICALL                                         $19     
         18        ASSIGN                                                   !7, $19
   15    19        CONCAT                                           ~21     !7, '+%2F+'
         20        CONCAT                                           ~22     ~21, !6
         21        ECHO                                                     ~22
   17    22        SUB                                              ~23     !7, !6
         23        ASSIGN                                                   !8, ~23
   20    24        IS_SMALLER_OR_EQUAL                              ~25     !0, !8
         25      > JMPZ_EX                                          ~25     ~25, ->28
         26    >   IS_SMALLER_OR_EQUAL                              ~26     !8, !1
         27        BOOL                                             ~25     ~26
         28    > > JMPZ                                                     ~25, ->31
   21    29    >   ECHO                                                     'code+1'
         30      > JMP                                                      ->44
   23    31    >   IS_SMALLER_OR_EQUAL                              ~27     !2, !8
         32      > JMPZ_EX                                          ~27     ~27, ->35
         33    >   IS_SMALLER_OR_EQUAL                              ~28     !8, !3
         34        BOOL                                             ~27     ~28
         35    > > JMPZ                                                     ~27, ->38
   24    36    >   ECHO                                                     'code+2'
         37      > JMP                                                      ->44
   26    38    >   IS_SMALLER_OR_EQUAL                              ~29     !4, !8
         39      > JMPZ_EX                                          ~29     ~29, ->42
         40    >   IS_SMALLER_OR_EQUAL                              ~30     !8, !5
         41        BOOL                                             ~29     ~30
         42    > > JMPZ                                                     ~29, ->44
   27    43    >   ECHO                                                     'code+3'
   28    44    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.94 ms | 941 KiB | 22 Q