3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (function_exists('date_default_timezone_set')) { date_default_timezone_set("Europe/London"); } echo date('d/m/Y', strtotime("-5 month", strtotime("first day of this month"))) ."\n"; echo date('d/m/Y', strtotime("-5 month", strtotime("first day this month"))) ."\n"; echo date('d/m/Y', strtotime("-5 month", strtotime(date('Y-m-01')))) ."\n";
Output for 5.3.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
01/02/2014 01/03/2014 01/02/2014
Output for 5.3.0 - 5.3.2
01/02/2014 01/02/2014 01/02/2014
Output for 4.3.5 - 5.0.5, 5.1.3 - 5.2.17
01/08/1969 01/03/2014 01/02/2014
Output for 5.1.0 - 5.1.2
01/01/1970 01/03/2014 01/02/2014
Output for 4.3.0 - 4.3.4
01/08/1969 29/03/2014 01/02/2014