Skip to content

Commit 510a7ce

Browse files
committed
Always use templates when possible
This performed better for Symfony Demo in my benchmarks, possibly due to better instruction caching.
1 parent df615f2 commit 510a7ce

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9836,11 +9836,7 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast, bool allow_templ
98369836
last_elem_ast = elem_ast;
98379837
}
98389838

9839-
if (!is_constant
9840-
&& (!allow_template
9841-
|| !use_template
9842-
/* Array templates are slower for n=1 arrays. */
9843-
|| list->children <= 1)) {
9839+
if (!is_constant && (!allow_template || !use_template)) {
98449840
ZVAL_UNDEF(result);
98459841
return 0;
98469842
}

0 commit comments

Comments
 (0)