|  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
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:
45 - 42 = ?
Subscribe to this entry?

 [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-2020 The PHP Group
All rights reserved.
Last updated: Fri Apr 03 09:01:23 2020 UTC