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) { $zone = new DateTimeZone($abbr); 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 = 28
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 28
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/t3StK
function name:  (null)
number of ops:  30
compiled vars:  !0 = $utc, !1 = $time, !2 = $abbr, !3 = $zone
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                                              $5      'DateTimeZone'
          4        SEND_VAL_EX                                              'UTC'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $5
    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  $8      
         12        ASSIGN                                                   !1, $8
    7    13      > FE_RESET_R                                       $10     <array>, ->28
         14    > > FE_FETCH_R                                               $10, !2, ->28
    8    15    >   NEW                                              $11     'DateTimeZone'
         16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !3, $11
    9    19        ROPE_INIT                                     3  ~16     !2
         20        ROPE_ADD                                      1  ~16     ~16, '%3A+'
         21        INIT_METHOD_CALL                                         !3, 'getOffset'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $14     
         24        ROPE_END                                      2  ~15     ~16, $14
         25        ECHO                                                     ~15
         26        ECHO                                                     '%0A'
    7    27      > JMP                                                      ->14
         28    >   FE_FREE                                                  $10
   10    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.75 ms | 1401 KiB | 15 Q