3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); echo date_default_timezone_get()."\n"; $dateStr = "20230120171222"; $timestamp1 = strtotime($dateStr); var_dump($timestamp1); $timestamp2 = strtotime($dateStr." UTC"); var_dump($timestamp2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jgSFX
function name:  (null)
number of ops:  24
compiled vars:  !0 = $dateStr, !1 = $timestamp1, !2 = $timestamp2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'America%2FNew_York'
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'date_default_timezone_get'
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      $4, '%0A'
          6        ECHO                                                     ~5
    6     7        ASSIGN                                                   !0, '20230120171222'
    7     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
    8    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
    9    15        INIT_FCALL                                               'strtotime'
         16        CONCAT                                           ~10     !0, '+UTC'
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !2, $11
   10    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.1 ms | 1004 KiB | 17 Q