php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #145 Problems with variables that seem integer
Submitted: 1998-03-04 14:37 UTC Modified: 1998-03-05 11:21 UTC
From: melo at co dot telenet dot pt Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0b3 OS: Linux
Private report: No CVE-ID: None
 [1998-03-04 14:37 UTC] melo at co dot telenet dot pt
First, it's not a crash, but it is reproducable... 

Try this:
<html>
<body>
<? if ($a) { echo "<h1>$a</h1>"; } ?>
<form method=post>
  insert a big number here (12 digits beginning with a 5 or bigger):
  <input type="text" name="a" value="<?echo $a?>">
  <input type="submit" name="test" value="Test!">
</form>
</body>
</html>

Try it with 1234567890 and 12345678901
The second value prints 2147483647
It's a overflow problem.
I think that php should treat webinput as strings until
the variable is used.
I'm assuming that php tries to guess the variable type

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-05 11:21 UTC] zeev
Turns out beta 1 was used.
beta 3 or always set the type of form variables as string.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Feb 20 00:01:25 2019 UTC