3v4l.org

run code in 300+ PHP versions simultaneously
<?php function timezoneExhibitsDST($tzId) { $tz = new DateTimeZone($tzId); $date = new DateTime("now",$tz); var_dump($date->format('c')); $trans = $tz->getTransitions(); foreach ($trans as $k => $t) if ($t["ts"] > $date->format('U')) { print_r($t); return $trans[$k-1]['isdst']; } } var_dump(timezoneExhibitsDST("Europe/London"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hJnAH
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'timezoneexhibitsdst'
          2        SEND_VAL                                                 'Europe%2FLondon'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function timezoneexhibitsdst:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 37
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 37
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 36
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/hJnAH
function name:  timezoneExhibitsDST
number of ops:  39
compiled vars:  !0 = $tzId, !1 = $tz, !2 = $date, !3 = $trans, !4 = $t, !5 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $6      'DateTimeZone'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    5     5        NEW                                              $9      'DateTime'
          6        SEND_VAL_EX                                              'now'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $9
    6    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !2, 'format'
         12        SEND_VAL_EX                                              'c'
         13        DO_FCALL                                      0  $12     
         14        SEND_VAR                                                 $12
         15        DO_ICALL                                                 
    7    16        INIT_METHOD_CALL                                         !1, 'getTransitions'
         17        DO_FCALL                                      0  $14     
         18        ASSIGN                                                   !3, $14
    8    19      > FE_RESET_R                                       $16     !3, ->37
         20    > > FE_FETCH_R                                       ~17     $16, !4, ->37
         21    >   ASSIGN                                                   !5, ~17
    9    22        FETCH_DIM_R                                      ~19     !4, 'ts'
         23        INIT_METHOD_CALL                                         !2, 'format'
         24        SEND_VAL_EX                                              'U'
         25        DO_FCALL                                      0  $20     
         26        IS_SMALLER                                               $20, ~19
         27      > JMPZ                                                     ~21, ->36
   10    28    >   INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                                 
   11    31        SUB                                              ~23     !5, 1
         32        FETCH_DIM_R                                      ~24     !3, ~23
         33        FETCH_DIM_R                                      ~25     ~24, 'isdst'
         34        FE_FREE                                                  $16
         35      > RETURN                                                   ~25
    8    36    > > JMP                                                      ->20
         37    >   FE_FREE                                                  $16
   13    38      > RETURN                                                   null

End of function timezoneexhibitsdst

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.6 ms | 1403 KiB | 18 Q