Bug #54096 [Opn->Asn]: wrong behavior FILTER_VALIDATE_INT -0 +0

From: Date: Wed, 26 Dec 2012 10:59:02 +0000
Subject: Bug #54096 [Opn->Asn]: wrong behavior FILTER_VALIDATE_INT -0 +0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175603@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54096&edit=1

 ID:                 54096
 Updated by:         mj@php.net
 Reported by:        _coola_ at arcor dot de
 Summary:            wrong behavior FILTER_VALIDATE_INT -0 +0
-Status:             Open
+Status:             Assigned
 Type:               Bug
 Package:            Filter related
 Operating System:   -
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        mj
 Block user comment: N
 Private report:     N

 New Comment:

The PR in https://github.com/php/php-src/pull/248 addresses
this issue.


Previous Comments:
------------------------------------------------------------------------
[2011-02-24 19:54:14] _coola_ at arcor dot de

It would also be nice if anybody would care about http://bugs.php.net/bug.php?id=53775

------------------------------------------------------------------------
[2011-02-24 19:51:27] _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




------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54096&edit=1


Thread (4 messages)

« previous php.bugs (#175603) next »