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
Output for 7.0.20 - 7.2.0
string(10) "1444644610" string(10) "1444644610"
Output for 7.0.6
string(10) "1462183810" string(10) "1462183810"
Output for 7.0.5
string(10) "1459591810" string(10) "1459591810"
Output for 7.0.4
string(10) "1457518210" string(10) "1457521810"
Output for 7.0.3
string(10) "1458209410" string(10) "1458213010"
Output for 7.0.2
string(10) "1458555010" string(10) "1458558610"
Output for 7.0.1
string(10) "1458641410" string(10) "1458645010"
Output for 7.0.0
string(10) "1458987010" string(10) "1458990610"
Output for 5.6.21
string(10) "1462097410" string(10) "1462097410"
Output for 5.6.20
string(10) "1460196610" string(10) "1460196610"
Output for 5.6.19
string(10) "1457259010" string(10) "1457262610"
Output for 5.6.18
string(10) "1457950210" string(10) "1457953810"
Output for 5.6.17
string(10) "1458295810" string(10) "1458299410"
Output for 5.6.16
string(10) "1459073410" string(10) "1459073410"
Output for 5.6.15
string(10) "1459159810" string(10) "1459159810"
Output for 5.6.14
string(10) "1459505410" string(10) "1459505410"
Output for 5.6.13
string(10) "1460628610" string(10) "1460628610"
Output for 5.6.12
string(10) "1460974210" string(10) "1460974210"
Output for 5.6.11
string(10) "1461319810" string(10) "1461319810"
Output for 5.6.10
string(10) "1461492610" string(10) "1461492610"
Output for 5.6.9
string(10) "1461665410" string(10) "1461665410"
Output for 5.6.8
string(10) "1461838210" string(10) "1461838210"
Output for 5.5.35
string(10) "1463911810" string(10) "1463911810"
Output for 5.5.34
string(10) "1460283010" string(10) "1460283010"
Output for 5.5.33
string(10) "1457345410" string(10) "1457349010"
Output for 5.5.32
string(10) "1458123010" string(10) "1458126610"
Output for 5.5.31
string(10) "1458382210" string(10) "1458385810"
Output for 5.5.30
string(10) "1459419010" string(10) "1459419010"
Output for 5.5.29
string(10) "1460801410" string(10) "1460801410"
Output for 5.5.28
string(10) "1461147010" string(10) "1461147010"
Output for 5.5.27
string(10) "1461233410" string(10) "1461233410"
Output for 5.5.26
string(10) "1461579010" string(10) "1461579010"
Output for 5.5.25
string(10) "1461751810" string(10) "1461751810"
Output for 5.5.24
string(10) "1463998210" string(10) "1463998210"
Output for 5.4.2 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/5fXUt 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/5fXUt on line 4
Process exited with code 255.