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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nasso dot k2 at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Sun Jul 05 21:01:04 2020 UTC