|  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
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:
Solve the problem:
14 + 45 = ?
Subscribe to this entry?

 [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:
<? 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!">

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


Add a Patch

Pull Requests

Add a Pull Request


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-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 10:03:43 2023 UTC