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 = (new DateTimeImmutable('today')) ->setTimeZone(new DateTimeZone('Europe/Rome')) ->setTime(10, 10, 10); var_dump($x->format('U')); var_dump($y->format('U'));
based on 6ElvY
Output for 5.6.28, 7.0.20 - 7.2.0
string(10) "1444644610" string(10) "1444723810"
Output for 7.0.6
string(10) "1462183810" string(10) "1462263010"
Output for 7.0.5
string(10) "1459591810" string(10) "1459671010"
Output for 7.0.4
string(10) "1457518210" string(10) "1457601010"
Output for 7.0.3
string(10) "1458209410" string(10) "1458292210"
Output for 7.0.2
string(10) "1458555010" string(10) "1458637810"
Output for 7.0.1
string(10) "1458641410" string(10) "1458724210"
Output for 7.0.0
string(10) "1458987010" string(10) "1459066210"
Output for 5.6.21
string(10) "1462097410" string(10) "1462176610"
Output for 5.6.20
string(10) "1460196610" string(10) "1460275810"
Output for 5.6.19
string(10) "1457259010" string(10) "1457341810"
Output for 5.6.18
string(10) "1457950210" string(10) "1458033010"
Output for 5.6.17
string(10) "1458295810" string(10) "1458378610"
Output for 5.6.16
string(10) "1459073410" string(10) "1459152610"
Output for 5.6.15
string(10) "1459159810" string(10) "1459239010"
Output for 5.6.14
string(10) "1459505410" string(10) "1459584610"
Output for 5.6.13
string(10) "1460628610" string(10) "1460707810"
Output for 5.6.12
string(10) "1460974210" string(10) "1461053410"
Output for 5.6.11
string(10) "1461319810" string(10) "1461399010"
Output for 5.6.10
string(10) "1461492610" string(10) "1461571810"
Output for 5.6.9
string(10) "1461665410" string(10) "1461744610"
Output for 5.6.8
string(10) "1461838210" string(10) "1461917410"
Output for 5.5.35
string(10) "1463825410" string(10) "1463904610"
Output for 5.5.34
string(10) "1460283010" string(10) "1460362210"
Output for 5.5.33
string(10) "1457345410" string(10) "1457428210"
Output for 5.5.32
string(10) "1458123010" string(10) "1458205810"
Output for 5.5.31
string(10) "1458382210" string(10) "1458465010"
Output for 5.5.30
string(10) "1459419010" string(10) "1459498210"
Output for 5.5.29
string(10) "1460715010" string(10) "1460794210"
Output for 5.5.28
string(10) "1461147010" string(10) "1461226210"
Output for 5.5.27
string(10) "1461233410" string(10) "1461312610"
Output for 5.5.26
string(10) "1461579010" string(10) "1461658210"
Output for 5.5.25
string(10) "1461751810" string(10) "1461831010"
Output for 5.5.24
string(10) "1463998210" string(10) "1464077410"
Output for 5.4.2 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/He0tb 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/He0tb on line 4
Process exited with code 255.