3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('+7 days 23:59:59'); echo $date->getTimestamp(); echo PHP_EOL; $date = new DateTime('today'); echo $date->getTimestamp();
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25, 5.6.28, 7.0.14 - 7.1.0
1392850799 1392159600
Output for 7.0.6
1462917599 1462226400
Output for 7.0.5
1460239199 1459548000
Output for 7.0.4
1458255599 1457564400
Output for 7.0.3
1458946799 1458255600
Output for 7.0.2
1459202399 1458514800
Output for 7.0.1
1459375199 1458687600
Output for 7.0.0
1459634399 1458946800
Output for 5.6.21
1462744799 1462053600
Output for 5.6.20
1460843999 1460152800
Output for 5.6.19
1457996399 1457305200
Output for 5.6.18
1458601199 1457910000
Output for 5.6.17
1459033199 1458342000
Output for 5.6.16
1459720799 1459033200
Output for 5.6.15
1459807199 1459116000
Output for 5.6.14
1460152799 1459461600
Output for 5.6.13
1461362399 1460671200
Output for 5.6.12
1461707999 1461016800
Output for 5.6.11
1461967199 1461276000
Output for 5.6.10
1462226399 1461535200
Output for 5.6.9
1462399199 1461708000
Output for 5.6.8
1462571999 1461880800
Output for 5.6.7
1464818399 1464127200
Output for 5.5.35
1464559199 1463868000
Output for 5.5.34
1460930399 1460239200
Output for 5.5.33
1458082799 1457391600
Output for 5.5.32
1458773999 1458082800
Output for 5.5.31
1459115999 1458428400
Output for 5.5.30
1460066399 1459375200
Output for 5.5.29
1461448799 1460757600
Output for 5.5.28
1461794399 1461103200
Output for 5.5.27
1461880799 1461189600
Output for 5.5.26
1462312799 1461621600
Output for 5.5.25
1462485599 1461794400
Output for 5.5.24
1464645599 1463954400
Output for 5.4.45
1442354399 1441663200
Output for 5.4.41 - 5.4.44
1440367199 1439676000
Output for 5.4.39 - 5.4.40
1431727199 1431036000
Output for 5.4.38
1425941999 1425250800
Output for 5.4.36 - 5.4.37
1424041199 1423350000
Output for 5.4.34 - 5.4.35
1418338799 1417647600
Output for 5.3.29, 5.4.26 - 5.4.32
1410645599 1409954400
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/IeO6E on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/IeO6E on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/IeO6E on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/IeO6E on line 3