3v4l.org

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

Function isdst:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Mrgp
function name:  isDST
number of ops:  12
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        DO_FCALL                                      0  $3      
          8        FETCH_DIM_R                                      ~4      $3, 0
          9        FETCH_DIM_R                                      ~5      ~4, 'isdst'
         10      > RETURN                                                   ~5
    4    11*     > RETURN                                                   null

End of function isdst

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.25 ms | 1397 KiB | 16 Q