3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.26 ms | 1404 KiB | 17 Q