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 f06df98 commit 025fe84Copy full SHA for 025fe84
Zend/tests/named_params/__call.phpt
@@ -0,0 +1,27 @@
1
+--TEST--
2
+Check that __invoke() works with named parameters
3
+--FILE--
4
+<?php
5
+
6
+class Test {
7
+ public function __call(string $method, array $args) {
8
+ $this->{'_'.$method}(...$args);
9
+ }
10
11
+ private function _method($a = 'a', $b = 'b') {
12
+ echo "a: $a, b: $b\n";
13
14
+}
15
16
+$test = new Test;
17
+$test->method('A', 'B');
18
+$test->method(a: 'A', b: 'B');
19
20
+?>
21
+--EXPECTF--
22
+a: A, b: B
23
24
+Fatal error: Uncaught Error: Unknown named parameter $a in %s:%d
25
+Stack trace:
26
+#0 {main}
27
+ thrown in %s on line %d
0 commit comments