3v4l.org

run code in 500+ PHP versions simultaneously
<?php ini_set('date.timezone', 'Asia/Shanghai'); var_dump(test('2019-10-27 07:55:00')); var_dump(test('2019-10-27 08:55:00')); var_dump(test('2019-10-27 09:55:00')); function test($testDate) { $format = 'Y-m-d H:i:s I'; $timezone = 'Europe/Paris'; $date = new DateTime($testDate); $date->setTimezone(new DateTimeZone($timezone)); return $date->format($format); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C1IJG
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'ini_set'
          1        SEND_VAL                                                     'date.timezone'
          2        SEND_VAL                                                     'Asia%2FShanghai'
          3        DO_ICALL                                                     
    4     4        INIT_FCALL                                                   'var_dump'
          5        INIT_FCALL_BY_NAME                                           'test'
          6        SEND_VAL_EX                                                  '2019-10-27+07%3A55%3A00'
          7        DO_FCALL                                          0  $1      
          8        SEND_VAR                                                     $1
          9        DO_ICALL                                                     
    5    10        INIT_FCALL                                                   'var_dump'
         11        INIT_FCALL_BY_NAME                                           'test'
         12        SEND_VAL_EX                                                  '2019-10-27+08%3A55%3A00'
         13        DO_FCALL                                          0  $3      
         14        SEND_VAR                                                     $3
         15        DO_ICALL                                                     
    6    16        INIT_FCALL                                                   'var_dump'
         17        INIT_FCALL_BY_NAME                                           'test'
         18        SEND_VAL_EX                                                  '2019-10-27+09%3A55%3A00'
         19        DO_FCALL                                          0  $5      
         20        SEND_VAR                                                     $5
         21        DO_ICALL                                                     
   15    22      > RETURN                                                       1

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
144.86 ms | 483 KiB | 9 Q