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'); foreach (['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) {} }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 35
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 35
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Found catch point at position: 33
Branch analysis from position: 33
2 jumps found. (Code = 107) Position 1 = 34, Position 2 = -2
Branch analysis from position: 34
filename:       /in/CpdG5
function name:  (null)
number of ops:  37
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        DO_FCALL                                      0  $9      
         15        ASSIGN                                                   !1, $9
    8    16      > FE_RESET_R                                       $11     <array>, ->35
         17    > > FE_FETCH_R                                               $11, !2, ->35
   10    18    >   INIT_METHOD_CALL                                         !1, 'setTimezone'
         19        NEW                                              $12     'DateTimeZone'
         20        SEND_VAR_EX                                              !2
         21        DO_FCALL                                      0          
         22        SEND_VAR_NO_REF_EX                                       $12
         23        DO_FCALL                                      0          
   11    24        ROPE_INIT                                     3  ~17     !2
         25        ROPE_ADD                                      1  ~17     ~17, '%3A+'
         26        INIT_METHOD_CALL                                         !1, 'format'
         27        SEND_VAL_EX                                              'D%2C+d+M+y+H%3Ai%3As+O'
         28        DO_FCALL                                      0  $15     
         29        ROPE_END                                      2  ~16     ~17, $15
         30        ECHO                                                     ~16
         31        ECHO                                                     '%0A'
         32      > JMP                                                      ->34
   12    33  E > > CATCH                                       last         'Exception'
    8    34    > > JMP                                                      ->17
         35    >   FE_FREE                                                  $11
   13    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.25 ms | 1400 KiB | 17 Q