3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2015-11-11 15:00:00', new DateTimeZone('CET')); var_dump($date); echo "\n Date timestamp using format(): " . $date->format('U'); echo "\n Date timestamp using getTimestamp(): " . $date->getTimestamp(); echo "\nChanging timezone to CET"; $date->setTimezone(new DateTimeZone('CET')); echo "\n Date timestamp using format(): " . $date->format('U') . ' NB: This has changed?!?!'; echo "\n Date timestamp using getTimestamp(): " . $date->getTimestamp() . ' NB: Now it is back?!?!'; echo "\n Date timestamp using format() again: " . $date->format('U') . ' NB: Now it is back?!?!'; ?>
based on cjq6I
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/n92tj
function name:  (null)
number of ops:  45
compiled vars:  !0 = $date
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $1      :-6
         1        SEND_VAL_EX                                              '2015-11-11+15%3A00%3A00'
         2        NEW                                              $2      :-3
         3        SEND_VAL_EX                                              'CET'
         4        DO_FCALL                                      0          
         5        SEND_VAR_NO_REF                               0          $2
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !0, $1
   4     8        INIT_FCALL                                               'var_dump'
         9        SEND_VAR                                                 !0
        10        DO_ICALL                                                 
   6    11        INIT_METHOD_CALL                                         !0, 'format'
        12        SEND_VAL_EX                                              'U'
        13        DO_FCALL                                      0  $7      
        14        CONCAT                                           ~8      '%0A+Date+timestamp+using+format%28%29%3A+++++++', $7
        15        ECHO                                                     ~8
   7    16        INIT_METHOD_CALL                                         !0, 'getTimestamp'
        17        DO_FCALL                                      0  $9      
        18        CONCAT                                           ~10     '%0A+Date+timestamp+using+getTimestamp%28%29%3A+', $9
        19        ECHO                                                     ~10
   9    20        ECHO                                                     '%0AChanging+timezone+to+CET'
  10    21        INIT_METHOD_CALL                                         !0, 'setTimezone'
        22        NEW                                              $11     :11
        23        SEND_VAL_EX                                              'CET'
        24        DO_FCALL                                      0          
        25        SEND_VAR_NO_REF                               0          $11
        26        DO_FCALL                                      0          
  12    27        INIT_METHOD_CALL                                         !0, 'format'
        28        SEND_VAL_EX                                              'U'
        29        DO_FCALL                                      0  $14     
        30        CONCAT                                           ~15     '%0A+Date+timestamp+using+format%28%29%3A+++++++', $14
        31        CONCAT                                           ~16     ~15, '+NB%3A+This+has+changed%3F%21%3F%21'
        32        ECHO                                                     ~16
  13    33        INIT_METHOD_CALL                                         !0, 'getTimestamp'
        34        DO_FCALL                                      0  $17     
        35        CONCAT                                           ~18     '%0A+Date+timestamp+using+getTimestamp%28%29%3A+', $17
        36        CONCAT                                           ~19     ~18, '+NB%3A+Now+it+is+back%3F%21%3F%21'
        37        ECHO                                                     ~19
  14    38        INIT_METHOD_CALL                                         !0, 'format'
        39        SEND_VAL_EX                                              'U'
        40        DO_FCALL                                      0  $20     
        41        CONCAT                                           ~21     '%0A+Date+timestamp+using+format%28%29+again%3A+', $20
        42        CONCAT                                           ~22     ~21, '+NB%3A+Now+it+is+back%3F%21%3F%21'
        43        ECHO                                                     ~22
        44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0