The Not ! operator in combination with NAN fails with OPcache enabled
还没有人认领这个 Issue。
评估
调研方向
使用 PHP 8.3.11 或其他受影响的版本,在启用和禁用 OPcache 的情况下重现报告中的最小 PHP 示例。然后跟踪 OPcache 优化器对比较和取反的处理;当 assertions 通过,并且在启用 OPcache 时两个输出都与预期值匹配,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
The following code:
$a = 100.0;
$b = \NAN;
$cmp = $a > $b; // since NAN always false;
$cmp2 = !($a > $b); // $expected true;
var_dump($cmp);
var_dump($cmp2);
assert($cmp === false);
assert($cmp2 === true);
Resulted in this output:
bool(false)
bool(true)
Resulted in this output with opcache enabled:
bool(false)
bool(false) ❌
But I expected this output instead:
bool(false)
bool(true)
The issue only seems to appear using opcache. Also spotted on different environments with older PHP versions.
PHP 8.3.11 (cli) (built: Aug 30 2024 16:21:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.11, Copyright (c) Zend Technologies
with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans
with Zend OPcache v8.3.11, Copyright (c), by Zend Technologies
PHP Version
PHP 8.3.11
Operating System
No response
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.2k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 103
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
php/php-src 的其他 Issue
-
Bug SAPI: cli_server Status: Verified
难度 2/5 1-3 小时 新手友好度 88/100
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 76/100
-
Bug Status: Needs Triage
难度 1/5 1 小时以内 新手友好度 90/100
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
-
Bug Category: Tests Status: Verified
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
HarbourMasters/Shipwright#7229 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 条评论 ·