|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 06:01:26 2024 UTC