From 29236bb66a87455616d7e220513349d7f515b494 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 16 Jun 2026 20:04:09 +0800 Subject: [PATCH] =?UTF-8?q?test(php):=20=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E5=B1=9E=E6=80=A7=E9=BB=98=E8=AE=A4=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=B9=B6=E7=A7=BB=E9=99=A4=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E5=88=9D=E5=A7=8B=E5=8C=96=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 multiple default array properties 测试用例 - 移除 ArrayInitPlan 的 requiresRuntimeInit 检查逻辑 - 简化 wrapArrayInitPlan 方法实现 --- src/Php/Translator.php | 4 -- .../object_property/default-array-002.phpt | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 tests/aot/object_property/default-array-002.phpt diff --git a/src/Php/Translator.php b/src/Php/Translator.php index 0f571bbf..823ce576 100644 --- a/src/Php/Translator.php +++ b/src/Php/Translator.php @@ -85,10 +85,6 @@ class Translator extends Preprocessor protected function wrapArrayInitPlan(ArrayInitPlan $plan, string $body): string { - if (!$plan->requiresRuntimeInit()) { - return $body; - } - return "do {\n" . $plan->init . $body . $plan->clean . "} while (0);\n"; } diff --git a/tests/aot/object_property/default-array-002.phpt b/tests/aot/object_property/default-array-002.phpt new file mode 100644 index 00000000..676de658 --- /dev/null +++ b/tests/aot/object_property/default-array-002.phpt @@ -0,0 +1,38 @@ +--TEST-- +multiple default array properties +--FILE-- + +--EXPECT-- +array(5) { + ["literalStrings"]=> + array(0) { + } + ["classMap"]=> + array(0) { + } + ["stdTypeMap"]=> + array(0) { + } + ["funcMap"]=> + array(0) { + } + ["propMap"]=> + array(0) { + } +}