3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(date("cc",strtotime("first day previous month"))); var_dump(date('Y-m-d', strtotime(date('Y-m-01').' -1 MONTH')));
Output for 5.1.0 - 5.2.17, 5.3.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(50) "2014-03-04T10:40:10+01:002014-03-04T10:40:10+01:00" string(10) "2014-02-01"
Output for 5.3.0 - 5.3.2
string(50) "2014-02-01T10:40:10+01:002014-02-01T10:40:10+01:00" string(10) "2014-02-01"
Output for 5.0.0 - 5.0.5
string(50) "1970-01-01T00:59:59+01:001970-01-01T00:59:59+01:00" string(10) "2014-02-01"
Output for 4.3.0 - 4.4.9
string(2) "cc" string(10) "2014-02-01"