1--TEST--
2Unknown named parameter
3--FILE--
4<?php
5
6function test($a) {
7}
8
9function test2(...$a) {
10}
11
12try {
13    test(b: 42);
14} catch (Error $e) {
15    echo $e->getMessage(), "\n";
16}
17
18try {
19    test(b: new stdClass);
20} catch (Error $e) {
21    echo $e->getMessage(), "\n";
22}
23
24try {
25    test(b: 2, a: 1);
26} catch (Error $e) {
27    echo $e->getMessage(), "\n";
28}
29
30try {
31    test(...new ArrayIterator(['unknown' => 42]));
32} catch (Error $e) {
33    echo $e->getMessage(), "\n";
34}
35
36try {
37    test2(a: 42);
38} catch (Error $e) {
39    echo $e->getMessage(), "\n";
40}
41
42?>
43--EXPECT--
44Unknown named parameter $b
45Unknown named parameter $b
46Unknown named parameter $b
47Unknown named parameter $unknown
48