php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54096 wrong behavior FILTER_VALIDATE_INT -0 +0
Submitted: 2011-02-24 19:51 UTC Modified: 2012-12-29 10:24 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: _coola_ at arcor dot de Assigned: mj
Status: Closed Package: Filter related
PHP Version: Irrelevant OS: -
Private report: No CVE-ID:
 [2011-02-24 19:51 UTC] _coola_ at arcor dot de
Description:
------------
Bug report #47752

error_reporting(-1); 
var_dump(filter_var('-0',FILTER_VALIDATE_INT)); // bool(false) 
var_dump(-0); // int(0) 

In my opinion FILTER_VALIDATE_INT must work like var_dump(-0);
Sooner or later we will get problems if everything works different.

PHP defines -0 as an int. So FILTER_VALIDATE_INT must also accept -0 and +0.

Thank you



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-24 19:54 UTC] _coola_ at arcor dot de
It would also be nice if anybody would care about http://bugs.php.net/bug.php?id=53775
 [2012-12-26 10:59 UTC] mj@php.net
The PR in https://github.com/php/php-src/pull/248 addresses this issue.
 [2012-12-26 10:59 UTC] mj@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mj
 [2012-12-29 10:24 UTC] mj@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-12-29 10:24 UTC] mj@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC