We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f593019 commit 1954aedCopy full SHA for 1954aed
Zend/tests/named_params/unknown_named_param.phpt
@@ -15,6 +15,12 @@ try {
15
echo $e->getMessage(), "\n";
16
}
17
18
+try {
19
+ test(b: 2, a: 1);
20
+} catch (Error $e) {
21
+ echo $e->getMessage(), "\n";
22
+}
23
+
24
try {
25
test2(a: 42);
26
} catch (Error $e) {
@@ -24,3 +30,4 @@ try {
30
?>
31
--EXPECT--
32
Unknown named parameter $b
33
+Unknown named parameter $b
Zend/zend_compile.c
@@ -3369,7 +3369,7 @@ uint32_t zend_compile_args(
3369
3370
if (fbc) {
3371
arg_num = zend_get_arg_num(fbc, arg_name);
3372
- if (arg_num == arg_count + 1) {
+ if (arg_num == arg_count + 1 && !may_have_undef) {
3373
/* Using named arguments, but passing in order. */
3374
arg_name = NULL;
3375
arg_count++;
0 commit comments