3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.93 ms | 1400 KiB | 17 Q