#50132 [Opn->Bgs]: a bug(?) in the time() function
| From: | rasmus@php.net | Date: | Mon, 09 Nov 2009 22:51:17 +0000 |
| Subject: | #50132 [Opn->Bgs]: a bug(?) in the time() function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144383@lists.php.net to get a copy of this message | ||
ID: 50132
Updated by: rasmus@php.net
Reported By: saber_lowbob at live dot de
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Windows Vista SP1
PHP Version: 5.2.11
New Comment:
Did you do any debugging at all to see why you might be getting that
result?
Hint, your regex string in the preg_replace() call is wrong.
Previous Comments:
------------------------------------------------------------------------
[2009-11-09 22:47:32] saber_lowbob at live dot de
Description:
------------
a bug(?) in the time() function
Reproduce code:
---------------
function isInt($string) {
$string = preg_replace('[0-9]','',$string);
if($string == '') {
return true;
} else {
return false;
}
}
if(isInt(time())) {
echo "is Int";
} else {
echo "is not Int";
}
Expected result:
----------------
is Int
Actual result:
--------------
is not Int
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50132&edit=1