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