#47745 [Opn->Asn]: FILTER_VALIDATE_INT doesn't allow minimum integer

From: Date: Thu, 26 Mar 2009 22:44:19 +0000
Subject: #47745 [Opn->Asn]: FILTER_VALIDATE_INT doesn't allow minimum integer
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-135187@lists.php.net to get a copy of this message
 ID:               47745
 Updated by:       scottmac@php.net
 Reported By:      for-bugs at hnw dot jp
-Status:           Open
+Status:           Assigned
 Bug Type:         Filter related
 Operating System: *
 PHP Version:      5.2.9
-Assigned To:      
+Assigned To:      iliaa
 New Comment:

For some reason php_filter_parse_int multiplies the integer by ten then
attempts to eat a 0? This is causing overflow and resulting in an
error.

I have no idea why its doing this though. ilia?


Previous Comments:
------------------------------------------------------------------------

[2009-03-21 23:34:01] for-bugs at hnw dot jp

Description:
------------
Although -2147483648 is the minimum integer in 32bit environment, 
FILTER_VALIDATE_INT says -2147483648 is invalid as integer.

Reproduce code:
---------------
<?php

var_dump(intval("-2147483648"));
var_dump(filter_var("-2147483648", FILTER_VALIDATE_INT));

Expected result:
----------------
int(-2147483648)
int(-2147483648)

Actual result:
--------------
int(-2147483648)
bool(false)


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


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



Thread (8 messages)

« previous php.bugs (#135187) next »