3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Berlin'); function GmtTimeToLocalTime($time) { //date_default_timezone_set('UTC'); $new_date = new DateTime($time); $new_date->setTimeZone(new DateTimeZone('Europe/Berlin')); return $new_date->format("Y-m-d H:i:s"); } var_dump(GmtTimeToLocalTime('2016-11-21 00:00:04 GMT'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L6epl
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FBerlin'
          2        DO_ICALL                                                 
   13     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'gmttimetolocaltime'
          5        SEND_VAL                                                 '2016-11-21+00%3A00%3A04+GMT'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function gmttimetolocaltime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L6epl
function name:  GmtTimeToLocalTime
number of ops:  16
compiled vars:  !0 = $time, !1 = $new_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        NEW                                              $2      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
    9     5        INIT_METHOD_CALL                                         !1, 'setTimeZone'
          6        NEW                                              $5      'DateTimeZone'
          7        SEND_VAL_EX                                              'Europe%2FBerlin'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $5
         10        DO_FCALL                                      0          
   10    11        INIT_METHOD_CALL                                         !1, 'format'
         12        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         13        DO_FCALL                                      0  $8      
         14      > RETURN                                                   $8
   11    15*     > RETURN                                                   null

End of function gmttimetolocaltime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.51 ms | 1398 KiB | 18 Q