3v4l.org

run code in 300+ PHP versions simultaneously
<?php $otime="12:00"; $ctime="23:00"; $open = strtotime(date("Y-m-d ").$otime); $close = strtotime(date("Y-m-d ").$ctime); If($close<$open) $close += 3600*24; If(time() >= $open && time() < $close){ Echo "open"; }Else{ Echo "closed"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 21
filename:       /in/ElhJY
function name:  (null)
number of ops:  34
compiled vars:  !0 = $otime, !1 = $ctime, !2 = $open, !3 = $close
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '12%3A00'
    3     1        ASSIGN                                                   !1, '23%3A00'
    4     2        INIT_FCALL                                               'strtotime'
          3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-m-d+'
          5        DO_ICALL                                         $6      
          6        CONCAT                                           ~7      $6, !0
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    5    10        INIT_FCALL                                               'strtotime'
         11        INIT_FCALL                                               'date'
         12        SEND_VAL                                                 'Y-m-d+'
         13        DO_ICALL                                         $10     
         14        CONCAT                                           ~11     $10, !1
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !3, $12
    7    18        IS_SMALLER                                               !3, !2
         19      > JMPZ                                                     ~14, ->21
         20    >   ASSIGN_OP                                     1          !3, 86400
    9    21    >   INIT_FCALL                                               'time'
         22        DO_ICALL                                         $16     
         23        IS_SMALLER_OR_EQUAL                              ~17     !2, $16
         24      > JMPZ_EX                                          ~17     ~17, ->29
         25    >   INIT_FCALL                                               'time'
         26        DO_ICALL                                         $18     
         27        IS_SMALLER                                       ~19     $18, !3
         28        BOOL                                             ~17     ~19
         29    > > JMPZ                                                     ~17, ->32
   10    30    >   ECHO                                                     'open'
         31      > JMP                                                      ->33
   12    32    >   ECHO                                                     'closed'
   13    33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.15 ms | 1396 KiB | 19 Q