|  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
 [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: Tue Oct 04 14:05:55 2022 UTC