[PHP-DEV] PHP 4.0 Bug #9451 Updated: Core maths problem with incrementation From: stas <email protected>
Date: 03/15/01

ID: 9451
Updated by: stas
Reported By: alex <email protected>
Old-Status: Open
Status: Closed
Bug Type: Math related
Assigned To:
Comments:

You are working with $variable as a string. Convert it to
integer with (int) or with adding 0 to it.

Previous Comments:
---------------------------------------------------------------------------

[2001-02-26 02:07:30] alex <email protected>
I wrote a poll section for the company i work for, on www.sgl.net.au.
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

so
$variable = - 1;
$variable++;

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

---------------------------------------------------------------------------

ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9451&edit=2

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>