Commit a652a00c02a for php.net
commit a652a00c02a4d7aa5bb6f7939aa2628b64dfbad5
Author: Arnaud Le Blanc <arnaud.lb@gmail.com>
Date: Tue Jul 28 18:29:39 2026 +0200
Follow-up GH-22829
diff --git a/Zend/Optimizer/dfa_pass.c b/Zend/Optimizer/dfa_pass.c
index dcb4e8bc841..8826ca41641 100644
--- a/Zend/Optimizer/dfa_pass.c
+++ b/Zend/Optimizer/dfa_pass.c
@@ -471,7 +471,7 @@ static uint32_t zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa)
}
if (call_info->caller_call_opline && call_info->caller_call_opline->opcode == ZEND_CALLABLE_CONVERT_PARTIAL) {
- /* Build a bitset of constant pre-bound PFA args: These are args whose value is alway the same for all
+ /* Build a bitset of constant pre-bound PFA args: These are args whose value is always the same for all
* instances of a PFA. */
uint32_t const_args = 0;
for (uint32_t i = 0, l = MIN(sizeof(const_args)*CHAR_BIT, call_info->num_args); i < l; i++) {
diff --git a/Zend/tests/partial_application/const_arg_opt.phpt b/Zend/tests/partial_application/const_arg_opt.phpt
index d63456a96a5..4b3afd1c2d2 100644
--- a/Zend/tests/partial_application/const_arg_opt.phpt
+++ b/Zend/tests/partial_application/const_arg_opt.phpt
@@ -46,12 +46,12 @@ function print_lexical_vars($f) {
echo "# Constant pre-bound argument:\n";
$f = f(2, ?);
print_lexical_vars($f);
-$f(2);
+$f(1);
echo "# Constant pre-bound argument (inverted):\n";
-$f = f(?, 2);
+$f = f(?, 3);
print_lexical_vars($f);
-$f(1);
+$f(4);
echo "# Inlined pre-bound argument:\n";
$f = f(g(), ?);
@@ -100,15 +100,15 @@ function print_lexical_vars($f) {
[0]=>
int(2)
[1]=>
- int(2)
+ int(1)
}
# Constant pre-bound argument (inverted):
no lexical vars
array(2) {
[0]=>
- int(1)
+ int(4)
[1]=>
- int(2)
+ int(3)
}
# Inlined pre-bound argument:
no lexical vars
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index a17cb3d91b9..a91f0d2c933 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -1352,7 +1352,7 @@ static zend_result ZEND_FASTCALL zend_ast_evaluate_inner(
ZEND_CALL_NUM_ARGS(frame), ZEND_CALL_ARG(frame, 1),
extra_named_params, named_positions,
fcc_ast->filename, &ast->lineno,
- (void**)cache_slot, fcc_ast->name, flags, 0);
+ (void**)cache_slot, fcc_ast->name, flags, /* const_args */ 0);
if (named_positions) {
zend_array_release(named_positions);