3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = "2016-05-25 09:30:00"; // This is the expected timestamp considering $time is in UTC. $timestamp = 1464168600; $format = "Y-m-d H:i:s"; $date = \DateTime::createFromFormat($format, $time, new \DateTimeZone('America/Tegucigalpa')); $t = $date->format('U'); //1464190200 var_dump($timestamp, $t); if ($t !== $timestamp) { throw new \Exception('¿??¿?¿'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tohfa
function name:  (null)
number of ops:  27
compiled vars:  !0 = $time, !1 = $timestamp, !2 = $format, !3 = $date, !4 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2016-05-25+09%3A30%3A00'
    5     1        ASSIGN                                                   !1, 1464168600
    6     2        ASSIGN                                                   !2, 'Y-m-d+H%3Ai%3As'
    7     3        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        NEW                                              $8      'DateTimeZone'
          7        SEND_VAL_EX                                              'America%2FTegucigalpa'
          8        DO_FCALL                                      0          
          9        SEND_VAR                                                 $8
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !3, $10
    8    12        INIT_METHOD_CALL                                         !3, 'format'
         13        SEND_VAL_EX                                              'U'
         14        DO_FCALL                                      0  $12     
         15        ASSIGN                                                   !4, $12
    9    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                                 
   10    20        IS_NOT_IDENTICAL                                         !4, !1
         21      > JMPZ                                                     ~15, ->26
   11    22    >   NEW                                              $16     'Exception'
         23        SEND_VAL_EX                                              '%C2%BF%3F%3F%C2%BF%3F%C2%BF'
         24        DO_FCALL                                      0          
         25      > THROW                                         0          $16
   12    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.98 ms | 1406 KiB | 15 Q