3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isMarketOpen($timestamp) { //>Wed 11:32:10 EST //$timezone = new DateTimeZone('EST'); $nowDate = new DateTime((string) $timestamp); $marketCloseTime = new DateTime('17:00:00 EST'); $marketOpenTime = new DateTime('08:00:00 EST'); echo $marketOpenTime->format('r'); echo "\n"; echo $nowDate->format('r'); return ($nowDate > $marketOpenTime && $nowDate < $marketCloseTime); } isMarketOpen('Wed 07:32:10 EST');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O0R1s
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'ismarketopen'
          1        SEND_VAL                                                 'Wed+07%3A32%3A10+EST'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function ismarketopen:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/O0R1s
function name:  isMarketOpen
number of ops:  29
compiled vars:  !0 = $timestamp, !1 = $nowDate, !2 = $marketCloseTime, !3 = $marketOpenTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    6     1        NEW                                              $4      'DateTime'
          2        CAST                                          6  ~5      !0
          3        SEND_VAL_EX                                              ~5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
    8     6        NEW                                              $8      'DateTime'
          7        SEND_VAL_EX                                              '17%3A00%3A00+EST'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $8
    9    10        NEW                                              $11     'DateTime'
         11        SEND_VAL_EX                                              '08%3A00%3A00+EST'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !3, $11
   10    14        INIT_METHOD_CALL                                         !3, 'format'
         15        SEND_VAL_EX                                              'r'
         16        DO_FCALL                                      0  $14     
         17        ECHO                                                     $14
   11    18        ECHO                                                     '%0A'
   12    19        INIT_METHOD_CALL                                         !1, 'format'
         20        SEND_VAL_EX                                              'r'
         21        DO_FCALL                                      0  $15     
         22        ECHO                                                     $15
   14    23        IS_SMALLER                                       ~16     !3, !1
         24      > JMPZ_EX                                          ~16     ~16, ->27
         25    >   IS_SMALLER                                       ~17     !1, !2
         26        BOOL                                             ~16     ~17
         27    > > RETURN                                                   ~16
   15    28*     > RETURN                                                   null

End of function ismarketopen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.17 ms | 1399 KiB | 14 Q