|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54146 0 not valid float
Submitted: 2011-03-03 02:23 UTC Modified: 2011-03-03 14:11 UTC
From: zb at nospam dot dk Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.3SVN-2011-03-03 (SVN) OS: OSX and Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
2 + 1 = ?
Subscribe to this entry?

 [2011-03-03 02:23 UTC] zb at nospam dot dk
From manual page:

As I understand the documentation, 0 (zero) should be a valid float, but it fails 
while testing.

Test script:

if (!filter_var($var, FILTER_VALIDATE_FLOAT))
echo "Not valid";
echo "Valid";



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-03 14:11 UTC]
-Status: Open +Status: Bogus
 [2011-03-03 14:11 UTC]
0 == false. Need to check return value a little more closely.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 18:01:28 2024 UTC