ID: 45977
User updated by: phocis at gmail dot com
Reported By: phocis at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: BSD
PHP Version: 5.2.6
New Comment:
So, I read the other bug report's comments a little more thoroughly and
found out about "Double timezone specification"s.
What I really wanted was a is_perfect_time:
function is_perfect_time($time){
$parsed = date_parse($time);
return (
$parsed['error_count'] === 0
&& $parsed['warning_count'] === 0
);
}
Sorry for the premature bug report.
-Carl
Previous Comments:
------------------------------------------------------------------------
[2008-09-02 22:57:05] phocis at gmail dot com
Description:
------------
Strtotime returns time() with any string that begins with 'eat'
While this is related to: http://bugs.php.net/bug.php?id=43960
It is not exactly the same.
Reproduce code:
---------------
var_dump(strtotime('10 September 2000'));
var_dump(strtotime('10 September 2000 asdfasdfasdf'));
var_dump(strtotime('asdfasdfasdf 10 September 2000'));
var_dump(strtotime('eat'));
var_dump(strtotime('eat asdfasdfasdf'));
var_dump(strtotime('asdfasdfasdf eat'));
var_dump(strtotime('EAT'));
Expected result:
----------------
int(968569200) # 10 sept 200
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
Actual result:
--------------
int(968569200) # 10 sept 200
bool(false)
bool(false)
int(1220360063) # time()
int(1220360063) # time()
bool(false)
int(1220360063) # time()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45977&edit=1