3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1 = new DateTime('2014+02:00'); $d2 = new DateTime('2014'); $d3 = new DateTime('2014', $d1->getTimeZone()); $d2->setTimeZone($d1->getTimeZone()); var_dump($d1->getTimestamp()); var_dump($d2->getTimestamp()); var_dump($d3->getTimestamp());
based on uT6jJ
Output for 5.4.26 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
int(1446660840) int(1446664440) int(1446660840)
Output for 7.0.6
int(1462299240) int(1462299240) int(1462299240)
Output for 7.0.5
int(1459707240) int(1459707240) int(1459707240)
Output for 7.0.4
int(1457633640) int(1457637240) int(1457633640)
Output for 7.0.3
int(1458324840) int(1458328440) int(1458324840)
Output for 7.0.2
int(1458756840) int(1458760440) int(1458756840)
Output for 7.0.1
int(1458843240) int(1458846840) int(1458843240)
Output for 7.0.0
int(1459102440) int(1459102440) int(1459102440)
Output for 5.6.21
int(1462212840) int(1462212840) int(1462212840)
Output for 5.6.20
int(1460312040) int(1460312040) int(1460312040)
Output for 5.6.19
int(1457460840) int(1457464440) int(1457460840)
Output for 5.6.18
int(1458065640) int(1458069240) int(1458065640)
Output for 5.6.17
int(1458411240) int(1458414840) int(1458497640)
Output for 5.6.16
int(1459188840) int(1459188840) int(1459188840)
Output for 5.6.15
int(1459275240) int(1459275240) int(1459275240)
Output for 5.6.14
int(1459620840) int(1459620840) int(1459620840)
Output for 5.6.13
int(1460744040) int(1460744040) int(1460744040)
Output for 5.6.12
int(1461176040) int(1461176040) int(1461176040)
Output for 5.6.11
int(1461521640) int(1461521640) int(1461521640)
Output for 5.6.10
int(1461608040) int(1461608040) int(1461608040)
Output for 5.6.9
int(1461780840) int(1461780840) int(1461780840)
Output for 5.6.8
int(1462040040) int(1462040040) int(1462040040)
Output for 5.5.35
int(1463940840) int(1463940840) int(1463940840)
Output for 5.5.34
int(1460398440) int(1460398440) int(1460398440)
Output for 5.5.33
int(1457547240) int(1457550840) int(1457547240)
Output for 5.5.32
int(1458238440) int(1458242040) int(1458238440)
Output for 5.5.31
int(1458584040) int(1458587640) int(1458584040)
Output for 5.5.30
int(1459534440) int(1459534440) int(1459534440)
Output for 5.5.29
int(1460916840) int(1460916840) int(1460916840)
Output for 5.5.28
int(1461262440) int(1461262440) int(1461262440)
Output for 5.5.27
int(1461348840) int(1461348840) int(1461348840)
Output for 5.5.26
int(1461694440) int(1461694440) int(1461694440)
Output for 5.5.25
int(1461867240) int(1461867240) int(1461867240)
Output for 5.5.24
int(1464113640) int(1464113640) int(1464113640)
Output for 5.3.19 - 5.4.25
Warning: DateTime::setTimezone(): Can only do this for zones with ID for now in /in/LlZKl on line 6 int(1446660840) int(1446664440) int(1446660840)