3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('2021-11-25T16:46:15+0200'); var_dump($dt->format('Y-m-d H:i:s')); $dt->setTimeZone(new DateTimeZone('UTC')); var_dump($dt->format('Y-m-d H:i:s')); $dt->setTimeZone(new DateTimeZone('-0600')); var_dump($dt->format('Y-m-d H:i:s')); $dt->setTimeZone(new DateTimeZone('UTC')); var_dump($dt->format('Y-m-d H:i:s'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QmLXt
function name:  (null)
number of ops:  47
compiled vars:  !0 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'DateTime'
          1        SEND_VAL_EX                                              '2021-11-25T16%3A46%3A15%2B0200'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    5     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'format'
          6        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
    7    10        INIT_METHOD_CALL                                         !0, 'setTimeZone'
         11        NEW                                              $6      'DateTimeZone'
         12        SEND_VAL_EX                                              'UTC'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $6
         15        DO_FCALL                                      0          
    9    16        INIT_FCALL                                               'var_dump'
         17        INIT_METHOD_CALL                                         !0, 'format'
         18        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
   11    22        INIT_METHOD_CALL                                         !0, 'setTimeZone'
         23        NEW                                              $11     'DateTimeZone'
         24        SEND_VAL_EX                                              '-0600'
         25        DO_FCALL                                      0          
         26        SEND_VAR_NO_REF_EX                                       $11
         27        DO_FCALL                                      0          
   13    28        INIT_FCALL                                               'var_dump'
         29        INIT_METHOD_CALL                                         !0, 'format'
         30        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         31        DO_FCALL                                      0  $14     
         32        SEND_VAR                                                 $14
         33        DO_ICALL                                                 
   15    34        INIT_METHOD_CALL                                         !0, 'setTimeZone'
         35        NEW                                              $16     'DateTimeZone'
         36        SEND_VAL_EX                                              'UTC'
         37        DO_FCALL                                      0          
         38        SEND_VAR_NO_REF_EX                                       $16
         39        DO_FCALL                                      0          
   17    40        INIT_FCALL                                               'var_dump'
         41        INIT_METHOD_CALL                                         !0, 'format'
         42        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         43        DO_FCALL                                      0  $19     
         44        SEND_VAR                                                 $19
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
43.27 ms | 467 KiB | 7 Q