ID: 29879 Updated by: [EMAIL PROTECTED] Reported By: info at peter-thomassen dot de -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: any -PHP Version: Irrelevant +PHP Version: 5.1 Assigned To: derick
Previous Comments: ------------------------------------------------------------------------ [2004-08-30 08:17:43] [EMAIL PROTECTED] This is going to be changed for 5.1, which will have new datetime parse/handling stuff. ------------------------------------------------------------------------ [2004-08-29 20:15:11] info at peter-thomassen dot de That's right, but I think -- since PHP5 is not that established to avoid any minor changes -- you can keep the old behaviour if zend.ze1_compatibility_mode is set to On and otherwise use more meaningful return values, can't you? I find it kind of sad if there wouldn't be any possibility to do proper date calculations, but another would be overkill ... ------------------------------------------------------------------------ [2004-08-29 19:01:48] [EMAIL PROTECTED] This change would break backwards compatibility. ------------------------------------------------------------------------ [2004-08-29 00:50:56] info at peter-thomassen dot de Description: ------------ If an invalid time is specified, strtotime() returns -1. Because -1 is ambiguous (it could also mean 1969-12-31 23:59:59 UTC), I request to return (bool)false on failure. BTW: http://www.gnu.org/software/tar/manual/html_chapter/tar_7.html#SEC117 which is mentioned in the docs allows a number preceded by an '@' for the time argument to represent seconds since the epoch. This results in an error -- shall I report another bug for that? Thanks! Reproduce code: --------------- <?php var_dump(strtotime('invalid')); ?> Expected result: ---------------- bool(false) Actual result: -------------- int(-1) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29879&edit=1