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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 21 11:01:30 2025 UTC