Re: question about backward-compatibility break/bug in php 5.2.6
| From: | Jordan Wambaugh | Date: | Thu, 24 Jul 2008 18:16:15 +0000 |
| Subject: | Re: question about backward-compatibility break/bug in php 5.2.6 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39278@lists.php.net to get a copy of this message | ||
On Jul 24, 2008, at 11:30 AM, Jack Steadman wrote:
The upshot is that we can't actually rely on strtotime to determine whether a string is a valid date/time. The docs don't ever explicitly say that the date strings themselves are checked for validity, but returning false on "failure" implies to me that it will return false if it can't get a *valid* date out of the string.-62169966000 is a valid date. Perhaps instead of checking if strtotime returns a false for your error condition, check if it returns a value < 1. -- Jordan CM Wambaugh Lead Software Engineer Forrent Media Solutions jordan.wambaugh@forrent.com