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) { + } +}