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 "{$abbr}: ERROR - {$e->getMessage()}", PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 38
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 38
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
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/d2gsd
function name:  (null)
number of ops:  40
compiled vars:  !0 = $time, !1 = $abbr, !2 = $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                                                 
    4     3        INIT_FCALL                                               'date_default_timezone_get'
          4        DO_ICALL                                         $4      
          5        ECHO                                                     $4
          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  $5      
         11        ASSIGN                                                   !0, $5
    7    12      > FE_RESET_R                                       $7      <array>, ->38
         13    > > FE_FETCH_R                                               $7, !1, ->38
    9    14    >   INIT_METHOD_CALL                                         !0, 'setTimezone'
         15        NEW                                              $8      'DateTimeZone'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $8
         19        DO_FCALL                                      0          
   10    20        ROPE_INIT                                     3  ~13     !1
         21        ROPE_ADD                                      1  ~13     ~13, '%3A+'
         22        INIT_METHOD_CALL                                         !0, 'format'
         23        SEND_VAL_EX                                              'D%2C+d+M+y+H%3Ai%3As+O'
         24        DO_FCALL                                      0  $11     
         25        ROPE_END                                      2  ~12     ~13, $11
         26        ECHO                                                     ~12
         27        ECHO                                                     '%0A'
         28      > JMP                                                      ->37
   11    29  E > > CATCH                                       last         'Exception'
   12    30    >   ROPE_INIT                                     3  ~17     !1
         31        ROPE_ADD                                      1  ~17     ~17, '%3A+ERROR+-+'
         32        INIT_METHOD_CALL                                         !2, 'getMessage'
         33        DO_FCALL                                      0  $15     
         34        ROPE_END                                      2  ~16     ~17, $15
         35        ECHO                                                     ~16
         36        ECHO                                                     '%0A'
    7    37    > > JMP                                                      ->13
         38    >   FE_FREE                                                  $7
   14    39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.66 ms | 1400 KiB | 17 Q