|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9451 Core maths problem with incrementation
Submitted: 2001-02-26 02:07 UTC Modified: 2001-03-15 09:16 UTC
From: alex at sgl dot net dot au Assigned:
Status: Closed Package: Math related
PHP Version: 4.0.4pl1 OS: Linux Redhat 6.0 (server)
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: alex at sgl dot net dot au
New email:
PHP Version: OS:


 [2001-02-26 02:07 UTC] alex at sgl dot net dot au
I wrote a poll section for the company i work for, on
I was testing boundary and illegal values with my script, and i set the number of votes for one of the options to
-1, when i click "Vote" it takes the -1 and increments it. (taken from a mysql_db) when it finishes incrementing it the resulting vote number is -2

$variable = - 1;

echo $variable prints out -2
The problem could be with mysql returning a positve integer only ,but i thought i'd mention it anyway


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-15 09:16 UTC]
You are working with $variable as a string. Convert it to
integer with (int) or with adding 0 to it.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 11:03:35 2022 UTC