3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump((new DateTime()) ->sub(new DateInterval('P1D')) ->format('Y-m-d H:i:s'));
Output for 5.5.34 - 5.5.35, 5.6.21 - 5.6.28, 7.0.6 - 7.3.0rc4
string(19) "2016-05-06 22:09:46"
Output for 5.5.32 - 5.5.33, 5.6.18 - 5.6.20, 7.0.4 - 7.0.5
string(19) "2016-05-06 22:09:47"
Output for 5.5.31, 5.6.15 - 5.6.17, 7.0.0 - 7.0.3
string(19) "2016-05-06 22:09:48"
Output for 5.5.28 - 5.5.30, 5.6.11 - 5.6.14
string(19) "2016-05-06 22:09:49"
Output for 5.5.25 - 5.5.27, 5.6.8 - 5.6.10
string(19) "2016-05-06 22:09:50"
Output for 5.5.20 - 5.5.24, 5.6.3 - 5.6.7
string(19) "2016-05-06 22:09:51"
Output for 5.5.13 - 5.5.19, 5.6.0 - 5.6.2
string(19) "2016-05-06 22:09:52"
Output for 5.5.3 - 5.5.12
string(19) "2016-05-06 22:09:53"
Output for 5.5.0 - 5.5.2
string(19) "2016-05-06 22:09:54"