3v4l.org

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

Function ismarketopen:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Jump found. Position 1 = -2
Branch analysis from position: 27
filename:       /in/UnT8U
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      :-6
         2        CAST                                          6  ~5      !0
         3        SEND_VAL_EX                                              ~5
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !1, $4
   8     6        NEW                                              $8      :-4
         7        SEND_VAL_EX                                              '17%3A00%3A00'
         8        DO_FCALL                                      0          
         9        ASSIGN                                                   !2, $8
   9    10        NEW                                              $11     :-1
        11        SEND_VAL_EX                                              '08%3A00%3A00'
        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 7.2.0