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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
40 - 2 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 20 02:01:29 2024 UTC