3v4l.org

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

Function ismarketopen:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/IZ6KB
function name:  isMarketOpen
number of ops:  27
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      
    4     1        NEW                                              $5      'DateTimeZone'
          2        SEND_VAL_EX                                              'EST'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
    5     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
    7    11        NEW                                              $12     'DateTime'
         12        SEND_VAL_EX                                              '17%3A00%3A00'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $12
    8    16        NEW                                              $15     'DateTime'
         17        SEND_VAL_EX                                              '08%3A00%3A00'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !4, $15
   10    21        IS_SMALLER                                       ~18     !4, !2
         22      > JMPZ_EX                                          ~18     ~18, ->25
         23    >   IS_SMALLER                                       ~19     !2, !3
         24        BOOL                                             ~18     ~19
         25    > > RETURN                                                   ~18
   11    26*     > RETURN                                                   null

End of function ismarketopen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.47 ms | 1398 KiB | 14 Q