3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatDateMerchantTimeZone($t, $tz) { $date = new DateTime($t, new DateTimeZone('UTC')); $date->setTimezone(new \DateTimeZone($tz)); return $date->format('Y-m-d H:i:s'); } echo formatDateMerchantTimeZone('2013-09-29 11:00', 'America/Los_Angeles');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I6TfD
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'formatdatemerchanttimezone'
          1        SEND_VAL                                                 '2013-09-29+11%3A00'
          2        SEND_VAL                                                 'America%2FLos_Angeles'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

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

End of function formatdatemerchanttimezone

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.09 ms | 939 KiB | 15 Q