#29342 [NEW]: strtotime(null) does not return -1
| From: | php dot net at gurugeek dot com | Date: | Thu, 22 Jul 2004 21:09:58 +0000 |
| Subject: | #29342 [NEW]: strtotime(null) does not return -1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-63371@lists.php.net to get a copy of this message | ||
From: php dot net at gurugeek dot com
Operating system: RHEL 3.0
PHP version: 5.0.0
PHP Bug Type: Date/time related
Bug description: strtotime(null) does not return -1
Description:
------------
Executing strtotime(null) returns midnight of the current day. The same
happens with strtotime(false).
[jrod@nagios01 libexec]$ php -r 'echo strtotime(null) . "\n";'
1090479600
[jrod@nagios01 libexec]$ php -r 'echo date("r", strtotime(null)) .
"\n";'
Thu, 22 Jul 2004 00:00:00 -0700
Reproduce code:
---------------
echo strtotime(null);
echo strtotime("");
Expected result:
----------------
-1
Actual result:
--------------
Midnight of the current day:
Thu, 22 Jul 2004 00:00:00 -0700
--
Edit bug report at http://bugs.php.net/?id=29342&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29342&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29342&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29342&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29342&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29342&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29342&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29342&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29342&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29342&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29342&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29342&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29342&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29342&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29342&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29342&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29342&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29342&r=float