php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56813 Maximum entirety turns over anything
Submitted: 2006-02-01 10:32 UTC Modified: 2006-02-02 07:32 UTC
From: x dot philbert at pixandlog dot com Assigned:
Status: Closed Package: filter (PECL)
PHP Version: 5.1.1 OS: Linux Gentoo
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: x dot philbert at pixandlog dot com
New email:
PHP Version: OS:

 

 [2006-02-01 10:32 UTC] x dot philbert at pixandlog dot com
Description:
------------
Input_get and filter FILTER_VALIDATE_INT, i try to test this value : 2147483648.
But input_get return me a negative value : -2147483648.
Documentation say that : Integer overflow
If you specify a number beyond the bounds of the integer  type, it will be interpreted as a float instead. Also, if you perform an operation that results in a number beyond the bounds of the integer type, a float will be returned instead.

documentation link : http://www.php.net/manual/en/language.types.integer.php

Here i expect a float value. It's normal or not ?
Thank you for your work.


Reproduce code:
---------------
$_GET['test'] = 2147483648;
<?php
$source = INPUT_GET;
$name = 'test';
$filter = FILTER_VALIDATE_INT;
var_dump(input_get($source, $name, $filter));
?>


Expected result:
----------------
float(2147483648)


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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-02 07:32 UTC] x dot philbert at pixandlog dot com
I close this bug because input_get with FILTER_VALIDATE_INT return always a integer. I check the max value with range because i need to know if value isn't a number beyond the bounds of the integer type.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC