3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set("America/Los_Angeles"); $startDate = "04/04/2016 7:00 AM America/New_York"; $ts = strtotime($startDate); $dt = new DateTime(); $dt->setTimestamp($ts); echo $dt->format("Y-m-d H:i:s\Z");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HsQOX
function name:  (null)
number of ops:  19
compiled vars:  !0 = $startDate, !1 = $ts, !2 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'America%2FLos_Angeles'
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, '04%2F04%2F2016+7%3A00+AM+America%2FNew_York'
    5     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    6     8        NEW                                              $7      'DateTime'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $7
    7    11        INIT_METHOD_CALL                                         !2, 'setTimestamp'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
    8    14        INIT_METHOD_CALL                                         !2, 'format'
         15        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As%5CZ'
         16        DO_FCALL                                      0  $11     
         17        ECHO                                                     $11
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.95 ms | 1395 KiB | 17 Q