#29342 [Opn->Csd]: strtotime(null) does not return -1

From: Date: Wed, 28 Jul 2004 01:45:03 +0000
Subject: #29342 [Opn->Csd]: strtotime(null) does not return -1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63657@lists.php.net to get a copy of this message
 ID:               29342
 Updated by:       iliaa@php.net
 Reported By:      php dot net at gurugeek dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Date/time related
 Operating System: RHEL 3.0
 PHP Version:      5.0.0
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2004-07-22 23:09:57] php dot net at gurugeek dot com

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 this bug report at http://bugs.php.net/?id=29342&edit=1


Thread (5 messages)

« previous php.bugs (#63657) next »