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('UTC', 'Europe/London', 'BST', 'Etc/GMT+1', 'GMT+1', 'CEST', 'EST', 'GMT-5') as $abbr) { try { $zone = new DateTimeZone($abbr); } catch (Exception $e) { echo "{$abbr}: ERROR - {$e->getMessage()}", PHP_EOL; } echo "{$abbr}: {$zone->getOffset($time)}", PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 37
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 37
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Found catch point at position: 20
Branch analysis from position: 20
2 jumps found. (Code = 107) Position 1 = 21, Position 2 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
filename:       /in/o8YO3
function name:  (null)
number of ops:  39
compiled vars:  !0 = $utc, !1 = $time, !2 = $abbr, !3 = $zone, !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>, ->37
         14    > > FE_FETCH_R                                               $11, !2, ->37
    9    15    >   NEW                                              $12     'DateTimeZone'
         16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !3, $12
         19      > JMP                                                      ->28
   10    20  E > > CATCH                                       last         'Exception'
   11    21    >   ROPE_INIT                                     3  ~17     !2
         22        ROPE_ADD                                      1  ~17     ~17, '%3A+ERROR+-+'
         23        INIT_METHOD_CALL                                         !4, 'getMessage'
         24        DO_FCALL                                      0  $15     
         25        ROPE_END                                      2  ~16     ~17, $15
         26        ECHO                                                     ~16
         27        ECHO                                                     '%0A'
   13    28    >   ROPE_INIT                                     3  ~21     !2
         29        ROPE_ADD                                      1  ~21     ~21, '%3A+'
         30        INIT_METHOD_CALL                                         !3, 'getOffset'
         31        SEND_VAR_EX                                              !1
         32        DO_FCALL                                      0  $19     
         33        ROPE_END                                      2  ~20     ~21, $19
         34        ECHO                                                     ~20
         35        ECHO                                                     '%0A'
    7    36      > JMP                                                      ->14
         37    >   FE_FREE                                                  $11
   14    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.52 ms | 1400 KiB | 15 Q