3v4l.org

run code in 300+ PHP versions simultaneously
<?php $offset = '+7:00'; // Calculate seconds from offset list($hours, $minutes) = explode(':', $offset); $seconds = $hours * 60 * 60 + $minutes * 60; // Get timezone name from seconds $tz = timezone_name_from_abbr('', $seconds, 1); // Workaround for bug #44780 if($tz === false) $tz = timezone_name_from_abbr('', $seconds, 0); // Set timezone date_default_timezone_set($tz); echo $tz . ': ' . date('r');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 29
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/uX3qO
function name:  (null)
number of ops:  39
compiled vars:  !0 = $offset, !1 = $hours, !2 = $minutes, !3 = $seconds, !4 = $tz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2B7%3A00'
    6     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        FETCH_LIST_R                                     $7      $6, 0
          6        ASSIGN                                                   !1, $7
          7        FETCH_LIST_R                                     $9      $6, 1
          8        ASSIGN                                                   !2, $9
          9        FREE                                                     $6
    7    10        MUL                                              ~11     !1, 60
         11        MUL                                              ~12     ~11, 60
         12        MUL                                              ~13     !2, 60
         13        ADD                                              ~14     ~12, ~13
         14        ASSIGN                                                   !3, ~14
    9    15        INIT_FCALL                                               'timezone_name_from_abbr'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !3
         18        SEND_VAL                                                 1
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !4, $16
   11    21        TYPE_CHECK                                    4          !4
         22      > JMPZ                                                     ~18, ->29
         23    >   INIT_FCALL                                               'timezone_name_from_abbr'
         24        SEND_VAL                                                 ''
         25        SEND_VAR                                                 !3
         26        SEND_VAL                                                 0
         27        DO_ICALL                                         $19     
         28        ASSIGN                                                   !4, $19
   13    29    >   INIT_FCALL                                               'date_default_timezone_set'
         30        SEND_VAR                                                 !4
         31        DO_ICALL                                                 
   15    32        CONCAT                                           ~22     !4, '%3A+'
         33        INIT_FCALL                                               'date'
         34        SEND_VAL                                                 'r'
         35        DO_ICALL                                         $23     
         36        CONCAT                                           ~24     ~22, $23
         37        ECHO                                                     ~24
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.43 ms | 1396 KiB | 21 Q