From: amykhar at gmail dot com Operating system: Mac OS X PHP version: 5.2.4 PHP Bug Type: Date/time related Bug description: strtotime returns valid dates for invalid entries
Description: ------------ If I enter a date with a text month and an invalid day, it returns as valid. Example, September 45, 1992 returns as valid. It THINKS the date is October 5, 1992. (The same is true for Sep 45, 1992). What it seems to do is to get the year correctly, then take the last digit of the day and then add 1 to the month. Reproduce code: --------------- $cdate = strtotime("September 45, 1992"); if(!$cdate){ echo(-1); exit; } else{ echo (date("M d Y",$cdate); } Expected result: ---------------- It echo -1. Actual result: -------------- It prints out October 5, 1992 -- Edit bug report at http://bugs.php.net/?id=42675&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42675&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42675&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42675&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42675&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42675&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42675&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42675&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42675&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42675&r=support Expected behavior: http://bugs.php.net/fix.php?id=42675&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42675&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42675&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42675&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42675&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42675&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42675&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42675&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42675&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42675&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42675&r=mysqlcfg