[php-src] PR #24064: Fix GH-24063: SCCP merges 0.0 and -0.0 into a single constant
| From: | lazerg | Date: | Fri, 02 Oct 2026 02:09:44 +0000 |
| Subject: | [php-src] PR #24064: Fix GH-24063: SCCP merges 0.0 and -0.0 into a single constant | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39062@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24064
Author: lazerg
SCCP joins phi values with
zend_is_identical(), which compares doubles with
==, so 0.0 and -0.0 count as the same value. A ternary like
$n < 0 ? -0.0 : 0.0 then gets folded to whichever constant the first branch held,
and the condition disappears. The same thing happens for constant arrays and for elements of partial
arrays.
The join now compares doubles bitwise (like compact_literals.c already does), recursing into arrays,
and falls back to zend_is_identical() for everything else.
Fixes GH-24063