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('O')); $trans = $tz->getTransitions(); foreach ($trans as $k => $t) if ($t["ts"] > $date->format('U')) { print_r($t); print_r($trans[$k-1]); 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/cpT7E
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     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 = 42
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 42
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 41
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/cpT7E
function name:  timezoneExhibitsDST
number of ops:  44
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                                              'O'
         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, ->42
         20    > > FE_FETCH_R                                       ~17     $16, !4, ->42
         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, ->41
   10    28    >   INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                                 
   11    31        INIT_FCALL                                               'print_r'
         32        SUB                                              ~23     !5, 1
         33        FETCH_DIM_R                                      ~24     !3, ~23
         34        SEND_VAL                                                 ~24
         35        DO_ICALL                                                 
   12    36        SUB                                              ~26     !5, 1
         37        FETCH_DIM_R                                      ~27     !3, ~26
         38        FETCH_DIM_R                                      ~28     ~27, 'isdst'
         39        FE_FREE                                                  $16
         40      > RETURN                                                   ~28
    8    41    > > JMP                                                      ->20
         42    >   FE_FREE                                                  $16
   14    43      > RETURN                                                   null

End of function timezoneexhibitsdst

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.88 ms | 1403 KiB | 18 Q