3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $utc = new DateTimeZone('UTC'); $time = DateTime::createFromFormat('Y-m-d H:i:s', '2014-05-19 11:30:00', $utc); foreach (array('BST', 'GMT+1', 'CEST', 'Etc/GMT+1') as $abbr) { $local = clone $time; try { $local->setTimezone(new DateTimeZone($abbr)); } catch (Exception $e) { echo "{$abbr}: ERROR - {$e->getMessage()}", PHP_EOL; } echo "{$abbr}: {$local->format(DATE_RFC822)}", PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 41
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 41
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Found catch point at position: 24
Branch analysis from position: 24
2 jumps found. (Code = 107) Position 1 = 25, Position 2 = -2
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
filename:       /in/5WYWF
function name:  (null)
number of ops:  43
compiled vars:  !0 = $utc, !1 = $time, !2 = $abbr, !3 = $local, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'UTC'
          2        DO_ICALL                                                 
    5     3        NEW                                              $6      'DateTimeZone'
          4        SEND_VAL_EX                                              'UTC'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $6
    6     7        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          8        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          9        SEND_VAL                                                 '2014-05-19+11%3A30%3A00'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !1, $9
    7    13      > FE_RESET_R                                       $11     <array>, ->41
         14    > > FE_FETCH_R                                               $11, !2, ->41
    8    15    >   CLONE                                            ~12     !1
         16        ASSIGN                                                   !3, ~12
   10    17        INIT_METHOD_CALL                                         !3, 'setTimezone'
         18        NEW                                              $14     'DateTimeZone'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
         21        SEND_VAR_NO_REF_EX                                       $14
         22        DO_FCALL                                      0          
         23      > JMP                                                      ->32
   11    24  E > > CATCH                                       last         'Exception'
   12    25    >   ROPE_INIT                                     3  ~19     !2
         26        ROPE_ADD                                      1  ~19     ~19, '%3A+ERROR+-+'
         27        INIT_METHOD_CALL                                         !4, 'getMessage'
         28        DO_FCALL                                      0  $17     
         29        ROPE_END                                      2  ~18     ~19, $17
         30        ECHO                                                     ~18
         31        ECHO                                                     '%0A'
   14    32    >   ROPE_INIT                                     3  ~23     !2
         33        ROPE_ADD                                      1  ~23     ~23, '%3A+'
         34        INIT_METHOD_CALL                                         !3, 'format'
         35        SEND_VAL_EX                                              'D%2C+d+M+y+H%3Ai%3As+O'
         36        DO_FCALL                                      0  $21     
         37        ROPE_END                                      2  ~22     ~23, $21
         38        ECHO                                                     ~22
         39        ECHO                                                     '%0A'
    7    40      > JMP                                                      ->14
         41    >   FE_FREE                                                  $11
   15    42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.85 ms | 1400 KiB | 15 Q