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(10, 10, 10); var_dump($x->format('U')); var_dump($y->format('U'));
based on He0tb
Output for 5.6.28, 7.0.20 - 7.2.0
string(10) "1444644610" string(10) "1444637410"
Output for 7.0.6
string(10) "1462183810" string(10) "1462176610"
Output for 7.0.5
string(10) "1459591810" string(10) "1459584610"
Output for 7.0.4
string(10) "1457518210" string(10) "1457514610"
Output for 7.0.3
string(10) "1458209410" string(10) "1458205810"
Output for 7.0.2
string(10) "1458555010" string(10) "1458551410"
Output for 7.0.1
string(10) "1458641410" string(10) "1458637810"
Output for 7.0.0
string(10) "1458987010" string(10) "1458983410"
Output for 5.6.21
string(10) "1462097410" string(10) "1462090210"
Output for 5.6.20
string(10) "1460196610" string(10) "1460189410"
Output for 5.6.19
string(10) "1457259010" string(10) "1457255410"
Output for 5.6.18
string(10) "1457950210" string(10) "1457946610"
Output for 5.6.17
string(10) "1458295810" string(10) "1458292210"
Output for 5.6.16
string(10) "1459073410" string(10) "1459066210"
Output for 5.6.15
string(10) "1459159810" string(10) "1459152610"
Output for 5.6.14
string(10) "1459505410" string(10) "1459498210"
Output for 5.6.13
string(10) "1460628610" string(10) "1460621410"
Output for 5.6.12
string(10) "1460974210" string(10) "1460967010"
Output for 5.6.11
string(10) "1461319810" string(10) "1461312610"
Output for 5.6.10
string(10) "1461492610" string(10) "1461485410"
Output for 5.6.9
string(10) "1461665410" string(10) "1461658210"
Output for 5.6.8
string(10) "1461838210" string(10) "1461831010"
Output for 5.5.35
string(10) "1463825410" string(10) "1463818210"
Output for 5.5.34
string(10) "1460283010" string(10) "1460275810"
Output for 5.5.33
string(10) "1457345410" string(10) "1457341810"
Output for 5.5.32
string(10) "1458123010" string(10) "1458119410"
Output for 5.5.31
string(10) "1458382210" string(10) "1458378610"
Output for 5.5.30
string(10) "1459419010" string(10) "1459411810"
Output for 5.5.29
string(10) "1460715010" string(10) "1460707810"
Output for 5.5.28
string(10) "1461147010" string(10) "1461139810"
Output for 5.5.27
string(10) "1461233410" string(10) "1461226210"
Output for 5.5.26
string(10) "1461579010" string(10) "1461571810"
Output for 5.5.25
string(10) "1461751810" string(10) "1461744610"
Output for 5.5.24
string(10) "1463998210" string(10) "1463991010"
Output for 5.4.2 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/7GRR2 on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/7GRR2 on line 4
Process exited with code 255.