# *= operator broken on Mac OS X and Windows [crit bug #23395]

- Thread: https://externals.io/message/1105
- Original archive: https://news-web.php.net/php.internals/1105
- Started by Edin Kadribasic on 2003-04-29T14:53:48+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #1105 — Edin Kadribasic — 2003-04-29T14:53:48+00:00

URL: https://externals.io/message/1105#1105

The following piece of code

$i = 1;
$i *= 10;
echo $i;

prints -2123890688 on Mac OS X, and 0 on Windows.

The following commit is where breakage occured:

http://cvs.php.net/diff.php/Zend/zend_operators.c?r1=1.129.2.1&r2=1.129.2.2&ty=u

I suggest for this patch to be reverted since the commit message
reads "Speed up, simplify, use ZEND_SIGNED_MULTIPLY_LONG in
mul_operation" which doesn't sound like a bug fix that should be in
the stable branch.

Edin

---

## #1106 — Wez Furlong — 2003-04-29T14:59:16+00:00

URL: https://externals.io/message/1105#1106 · In reply to: #1105

This patch corrects the problem by not destroying the op1 value during
multiplication.

--Wez.



> The following piece of code
>
> $i = 1;
> $i *= 10;
> echo $i;
>
> prints -2123890688 on Mac OS X, and 0 on Windows.
>
> The following commit is where breakage occured:
>
> http://cvs.php.net/diff.php/Zend/zend_operators.c?r1=1.129.2.1&r2=1.129.2.2&ty=u
>
> I suggest for this patch to be reverted since the commit message
> reads "Speed up, simplify, use ZEND_SIGNED_MULTIPLY_LONG in
> mul_operation" which doesn't sound like a bug fix that should be in
> the stable branch.
>
> Edin

---

## #1107 — Sascha Schumann — 2003-04-29T15:00:55+00:00

URL: https://externals.io/message/1105#1107 · In reply to: #1106

> This patch corrects the problem by not destroying the op1 value during
> multiplication.

    Looks good to me.

    - Sascha
