ID: 50132
Updated by: [email protected]
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