3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isMarketOpen($timestamp) { //>Wed 11:32:10 EST $timezone = new DateTimeZone('America/New_York'); $nowDate = new DateTime((string) $timestamp, $timezone); $marketCloseTime = new DateTime('5PM', $timezone); $marketOpenTime = new DateTime('8AM', $timezone); 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/iRSLt
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 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/iRSLt
function name:  isMarketOpen
number of ops:  36
compiled vars:  !0 = $timestamp, !1 = $timezone, !2 = $nowDate, !3 = $marketCloseTime, !4 = $marketOpenTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        NEW                                              $5      'DateTimeZone'
          2        SEND_VAL_EX                                              'America%2FNew_York'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
    6     5        NEW                                              $8      'DateTime'
          6        CAST                                          6  ~9      !0
          7        SEND_VAL_EX                                              ~9
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $8
    8    11        NEW                                              $12     'DateTime'
         12        SEND_VAL_EX                                              '5PM'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $12
    9    16        NEW                                              $15     'DateTime'
         17        SEND_VAL_EX                                              '8AM'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !4, $15
   10    21        INIT_METHOD_CALL                                         !4, 'format'
         22        SEND_VAL_EX                                              'r'
         23        DO_FCALL                                      0  $18     
         24        ECHO                                                     $18
   11    25        ECHO                                                     '%0A'
   12    26        INIT_METHOD_CALL                                         !2, 'format'
         27        SEND_VAL_EX                                              'r'
         28        DO_FCALL                                      0  $19     
         29        ECHO                                                     $19
   14    30        IS_SMALLER                                       ~20     !4, !2
         31      > JMPZ_EX                                          ~20     ~20, ->34
         32    >   IS_SMALLER                                       ~21     !2, !3
         33        BOOL                                             ~20     ~21
         34    > > RETURN                                                   ~20
   15    35*     > RETURN                                                   null

End of function ismarketopen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.23 ms | 1394 KiB | 14 Q