3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isDST(\DateTime $date){ return $date->getTimezone()->getTransitions($date->getTimestamp(), $date->getTimestamp())[0]['isdst']; } $date = new \DateTime('2014-03-31', new \DateTimeZone('America/New_York')); var_dump(isDST($date));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lUunc
function name:  (null)
number of ops:  15
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'DateTime'
          1        SEND_VAL_EX                                              '2014-03-31'
          2        NEW                                              $2      'DateTimeZone'
          3        SEND_VAL_EX                                              'America%2FNew_York'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $1
    8     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'isdst'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function isdst:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lUunc
function name:  isDST
number of ops:  15
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_METHOD_CALL                                         !0, 'getTimezone'
          2        DO_FCALL                                      0  $1      
          3        INIT_METHOD_CALL                                         $1, 'getTransitions'
          4        INIT_METHOD_CALL                                         !0, 'getTimestamp'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR_NO_REF_EX                                       $2
          7        INIT_METHOD_CALL                                         !0, 'getTimestamp'
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR_NO_REF_EX                                       $3
         10        DO_FCALL                                      0  $4      
         11        FETCH_DIM_R                                      ~5      $4, 0
         12        FETCH_DIM_R                                      ~6      ~5, 'isdst'
         13      > RETURN                                                   ~6
    4    14*     > RETURN                                                   null

End of function isdst

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.3 ms | 1390 KiB | 16 Q