#41964 [Asn->Csd]: strtotime returns a timestamp for non-time string of pattern '(A|a) .+'
| From: | derick@php.net | Date: | Thu, 12 Jul 2007 19:02:15 +0000 |
| Subject: | #41964 [Asn->Csd]: strtotime returns a timestamp for non-time string of pattern '(A|a) .+' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114982@lists.php.net to get a copy of this message | ||
ID: 41964
Updated by: derick@php.net
Reported By: al dot vazquez at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: Linux
PHP Version: 5.2.3
Assigned To: derick
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:
------------------------------------------------------------------------
[2007-07-11 16:22:02] derick@php.net
There is indeed a bug:
derick@kossu:~$ php -r 'var_dump(date_parse("A"));'
array(12) {
["year"]=>
bool(false)
["month"]=>
bool(false)
["day"]=>
bool(false)
["hour"]=>
bool(false)
["minute"]=>
bool(false)
["second"]=>
bool(false)
["fraction"]=>
bool(false)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(1)
["errors"]=>
array(1) {
[0]=>
string(12) "Empty string"
}
["is_localtime"]=>
bool(false)
}
It is not an empty string...
Derick
------------------------------------------------------------------------
[2007-07-11 15:35:01] al dot vazquez at gmail dot com
Description:
------------
strtotime return the current timestamp for the values 'A Revolution in
Development' and 'a nothing'. Expected return value is false. This seems
to be tripped by the first character being the letter 'a' or 'A'
followed by a space followed by more text.
Reproduce code:
---------------
echo strtotime('Ask the Experts');
echo strtotime('A ');
echo strtotime('A');
echo strtotime('a ');
echo strtotime('a');
echo strtotime('A Revolution in Development');
echo strtotime('a nothing');
Expected result:
----------------
false
false
false
false
false
false
false
Actual result:
--------------
false
false
false
false
false
current timestamp
current timestamp
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41964&edit=1