3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = "5:00AM"; $endTime = "8:00AM"; $startTime = new DateTime($startTime); $endTime = new DateTime($endTime); $now = new DateTime(); if ($now >= $startTime && $now < $endTime) { echo "Time now ({$now->format('h:i a')}) is between start ({$startTime->format('h:i a')}) and end ({$endTime->format('h:i a')}) times"; } else { echo "Time now ({$now->format('h:i a')}) is NOT between start ({$startTime->format('h:i a')}) and end ({$endTime->format('h:i a')}) times"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 36
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/ihJYS
function name:  (null)
number of ops:  54
compiled vars:  !0 = $startTime, !1 = $endTime, !2 = $now
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '5%3A00AM'
    4     1        ASSIGN                                                   !1, '8%3A00AM'
    6     2        NEW                                              $5      'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $5
    7     6        NEW                                              $8      'DateTime'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $8
    9    10        NEW                                              $11     'DateTime'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $11
   10    13        IS_SMALLER_OR_EQUAL                              ~14     !0, !2
         14      > JMPZ_EX                                          ~14     ~14, ->17
         15    >   IS_SMALLER                                       ~15     !2, !1
         16        BOOL                                             ~14     ~15
         17    > > JMPZ                                                     ~14, ->36
   11    18    >   ROPE_INIT                                     7  ~20     'Time+now+%28'
         19        INIT_METHOD_CALL                                         !2, 'format'
         20        SEND_VAL_EX                                              'h%3Ai+a'
         21        DO_FCALL                                      0  $16     
         22        ROPE_ADD                                      1  ~20     ~20, $16
         23        ROPE_ADD                                      2  ~20     ~20, '%29+is+between+start+%28'
         24        INIT_METHOD_CALL                                         !0, 'format'
         25        SEND_VAL_EX                                              'h%3Ai+a'
         26        DO_FCALL                                      0  $17     
         27        ROPE_ADD                                      3  ~20     ~20, $17
         28        ROPE_ADD                                      4  ~20     ~20, '%29+and+end+%28'
         29        INIT_METHOD_CALL                                         !1, 'format'
         30        SEND_VAL_EX                                              'h%3Ai+a'
         31        DO_FCALL                                      0  $18     
         32        ROPE_ADD                                      5  ~20     ~20, $18
         33        ROPE_END                                      6  ~19     ~20, '%29+times'
         34        ECHO                                                     ~19
   10    35      > JMP                                                      ->53
   13    36    >   ROPE_INIT                                     7  ~28     'Time+now+%28'
         37        INIT_METHOD_CALL                                         !2, 'format'
         38        SEND_VAL_EX                                              'h%3Ai+a'
         39        DO_FCALL                                      0  $24     
         40        ROPE_ADD                                      1  ~28     ~28, $24
         41        ROPE_ADD                                      2  ~28     ~28, '%29+is+NOT+between+start+%28'
         42        INIT_METHOD_CALL                                         !0, 'format'
         43        SEND_VAL_EX                                              'h%3Ai+a'
         44        DO_FCALL                                      0  $25     
         45        ROPE_ADD                                      3  ~28     ~28, $25
         46        ROPE_ADD                                      4  ~28     ~28, '%29+and+end+%28'
         47        INIT_METHOD_CALL                                         !1, 'format'
         48        SEND_VAL_EX                                              'h%3Ai+a'
         49        DO_FCALL                                      0  $26     
         50        ROPE_ADD                                      5  ~28     ~28, $26
         51        ROPE_END                                      6  ~27     ~28, '%29+times'
         52        ECHO                                                     ~27
   14    53    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.04 ms | 1004 KiB | 13 Q