From 93367a722eda46406d18a7a6f198adcdb47ca074 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 16 Jun 2026 17:09:15 +0800 Subject: [PATCH] =?UTF-8?q?test(const):=20=E6=B7=BB=E5=8A=A0=E9=9B=B6?= =?UTF-8?q?=E5=80=BC=E7=B1=BB=E5=B8=B8=E9=87=8F=E4=BD=9C=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E9=94=AE=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建了测试文件 zero-const.phpt 验证类常量值为0的情况 - 测试了将值为0的类常量用作数组键的功能 - 验证了返回数组中键值对的正确性 - 确保类型转换和数据完整性符合预期行为 --- tests/aot/const/zero-const.phpt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/aot/const/zero-const.phpt diff --git a/tests/aot/const/zero-const.phpt b/tests/aot/const/zero-const.phpt new file mode 100644 index 00000000..5e3dafff --- /dev/null +++ b/tests/aot/const/zero-const.phpt @@ -0,0 +1,29 @@ +--TEST-- +class const with value 0 used as array key +--FILE-- + 'a', + ]; + return $list; + } +} + +function main(): void +{ + $test = new Test; + var_dump('test', $test->aaa()); +} +?> +--EXPECT-- +string(4) "test" +array(1) { + [0]=> + string(1) "a" +}