|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56650 Postive float returned when negative float given
Submitted: 2005-11-14 18:50 UTC Modified: 2005-11-16 18:57 UTC
From: Assigned: derick (profile)
Status: Closed Package: filter (PECL)
PHP Version: Irrelevant OS: -
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-11-14 18:50 UTC]
When passing a negative float to filter_data() and filtering on FL_FLOAT, a positive float is returned. It should return a negative float like FL_INT does for integers.

(I have a patch for this that I will submit.)

Reproduce code:
$float = '-34.78';

var_dump(filter_data($float, FL_FLOAT));

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-14 19:16 UTC]
Index: logical_filters.c
RCS file: /repository/pecl/filter/logical_filters.c,v
retrieving revision 1.8
diff -u -u -r1.8 logical_filters.c
--- logical_filters.c	28 Sep 2005 09:14:43 -0000	1.8
+++ logical_filters.c	14 Nov 2005 23:33:44 -0000
@@ -240,6 +240,7 @@
 stateR: /* state 'return' */
+    ctx_value *= ctx_multiply;
 	Z_TYPE_P(value) = IS_DOUBLE;
 	Z_DVAL_P(value) = ctx_value;
 [2005-11-16 18:57 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 21:01:31 2024 UTC