3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = (new DateTimeImmutable('today')) ->setTimeZone(new DateTimeZone('UTC')) ->setTime(10, 10, 10); $y = clone $x; $y = $y ->setTimeZone(new DateTimeZone('Europe/Rome')) ->setTime(12, 10, 10); var_dump($x->format('U')); var_dump($y->format('U'));
based on 7GRR2
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/5fXUt
function name:  (null)
number of ops:  42
compiled vars:  !0 = $x, !1 = $y
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $2      :-6
         1        SEND_VAL_EX                                              'today'
         2        DO_FCALL                                      0          
   4     3        INIT_METHOD_CALL                                         $2, 'setTimeZone'
         4        NEW                                              $4      :-1
         5        SEND_VAL_EX                                              'UTC'
         6        DO_FCALL                                      0          
         7        SEND_VAR_NO_REF                               0          $4
         8        DO_FCALL                                      0  $6      
   5     9        INIT_METHOD_CALL                                         $6, 'setTime'
        10        SEND_VAL_EX                                              10
        11        SEND_VAL_EX                                              10
        12        SEND_VAL_EX                                              10
        13        DO_FCALL                                      0  $7      
        14        ASSIGN                                                   !0, $7
   6    15        CLONE                                            $9      !0
        16        ASSIGN                                                   !1, $9
   8    17        INIT_METHOD_CALL                                         !1, 'setTimeZone'
        18        NEW                                              $11     :9
        19        SEND_VAL_EX                                              'Europe%2FRome'
        20        DO_FCALL                                      0          
        21        SEND_VAR_NO_REF                               0          $11
        22        DO_FCALL                                      0  $13     
   9    23        INIT_METHOD_CALL                                         $13, 'setTime'
        24        SEND_VAL_EX                                              12
        25        SEND_VAL_EX                                              10
        26        SEND_VAL_EX                                              10
        27        DO_FCALL                                      0  $14     
        28        ASSIGN                                                   !1, $14
  11    29        INIT_FCALL                                               'var_dump'
        30        INIT_METHOD_CALL                                         !0, 'format'
        31        SEND_VAL_EX                                              'U'
        32        DO_FCALL                                      0  $16     
        33        SEND_VAR                                                 $16
        34        DO_ICALL                                                 
  12    35        INIT_FCALL                                               'var_dump'
        36        INIT_METHOD_CALL                                         !1, 'format'
        37        SEND_VAL_EX                                              'U'
        38        DO_FCALL                                      0  $18     
        39        SEND_VAR                                                 $18
        40        DO_ICALL                                                 
        41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0