3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = time(); $result[0] = date('Y-m-09'); for ($i = 1; $i < 12; $i++) { $date = strtotime('next month', $date); $result[$i] = date('Y-m-d', $date); } var_dump($result);
based on 5FXji
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
array(12) { [0]=> string(10) "2017-06-09" [1]=> string(10) "2017-07-29" [2]=> string(10) "2017-08-29" [3]=> string(10) "2017-09-29" [4]=> string(10) "2017-10-29" [5]=> string(10) "2017-11-29" [6]=> string(10) "2017-12-29" [7]=> string(10) "2018-01-29" [8]=> string(10) "2018-03-01" [9]=> string(10) "2018-04-01" [10]=> string(10) "2018-05-01" [11]=> string(10) "2018-06-01" }