php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42872 $a -= $b; is not equal to $a = $a - $b;
Submitted: 2007-10-05 23:09 UTC Modified: 2007-10-06 00:05 UTC
From: nasso dot k2 at gmail dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.2.3 OS: Windows XP
Private report: No CVE-ID: None
 [2007-10-05 23:09 UTC] nasso dot k2 at gmail dot com
Description:
------------
$large_num -= 1000000 is not equal to $large_num = $large_num - 1000000;

Reproduce code:
---------------
$large_num = 1234567890;
while($large_num >= 1000000) $large_num -= 1000000;

Expected result:
----------------
1233567890

Actual result:
--------------
0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-05 23:47 UTC] jani@php.net
I'm not sure what you're trying to achieve here since your reproduce script is just nonsense. Please provide a self-contained script that begins with '<?php' and ends with '?>' like a PHP scripts usually do.
 [2007-10-06 00:02 UTC] nasso dot k2 at gmail dot com
Problem vanished when updated to 5.2.4, probably my old 5.2.3 was little buggy. Remove this submition, please.
 [2007-10-06 00:05 UTC] jani@php.net
I don't think there was any problem in 5.2.3 either..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC