strtotime on incorrect dates

Viewed 1542

I found something odd about strtotime().

On dates that do not exist it returns the day after.

$d30= strtotime("2017-06-30");
Echo $d30 ."\n";
Echo date("Y-m-d", $d30)."\n\n";  // 2017-06-30

$d31= strtotime("2017-06-31");
Echo $d31 ."\n";
Echo date("Y-m-d", $d31)."\n\n";  // 2017-07-01

$d32= strtotime("2017-06-32");
Echo $d32 ."\n";
Echo date("Y-m-d", $d32);         // 1970-01-01

https://3v4l.org/AjMAE

I understand the last one. It returns nothing as it's an error.
But why does the second one return first of July?
Is it a meant to be functional, in case you make a mistake it will "correct you"? Or is it a true bug in strtotime()?

2 Answers
Related