@@ -3,10 +3,10 @@ __call() can be partially applied
33--FILE--
44<?php
55class Foo {
6- public function __call ($ method , $ args ) {
6+ public function __call ($ method , $ arguments ) {
77 printf ("%s::%s \n" , __CLASS__ , $ method );
88
9- var_dump (...$ args );
9+ var_dump (...$ arguments );
1010 }
1111}
1212
@@ -22,19 +22,15 @@ try {
2222 printf ("%s: %s \n" , $ ex ::class, $ ex ->getMessage ());
2323}
2424
25- try {
26- $ bar (1 , 2 );
27- } catch (Error $ ex ) {
28- printf ("%s: %s \n" , $ ex ::class, $ ex ->getMessage ());
29- }
30-
25+ $ bar (1 , 2 );
3126$ bar (1 );
3227
3328$ bar = $ foo ->method (?, ...);
3429
3530echo (string ) new ReflectionFunction ($ bar );
3631
3732$ bar (10 );
33+ $ bar (10 , 20 );
3834
3935$ bar = $ foo ->method (new Foo , ...);
4036
@@ -47,7 +43,7 @@ Closure [ <user> public method {closure:%s:%d} ] {
4743 @@ %s 12 - 12
4844
4945 - Parameters [1] {
50- Parameter #0 [ <required> $args0 ]
46+ Parameter #0 [ <required> mixed $arguments0 ]
5147 }
5248}
5349ArgumentCountError: Too few arguments to function Foo::{closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
@@ -56,24 +52,27 @@ int(1)
5652Foo::method
5753int(1)
5854Closure [ <user> public method {closure:%s:%d} ] {
59- @@ %s 30 - 30
55+ @@ %s 25 - 25
6056
6157 - Parameters [2] {
62- Parameter #0 [ <required> $args0 ]
63- Parameter #1 [ <optional> ...$args ]
58+ Parameter #0 [ <required> mixed $arguments0 ]
59+ Parameter #1 [ <optional> mixed ...$arguments ]
6460 }
6561}
6662Foo::method
6763int(10)
64+ Foo::method
65+ int(10)
66+ int(20)
6867Closure [ <user> public method {closure:%s:%d} ] {
69- @@ %s 36 - 36
68+ @@ %s 32 - 32
7069
7170 - Bound Variables [1] {
72- Variable #0 [ $args0 ]
71+ Variable #0 [ $arguments0 ]
7372 }
7473
7574 - Parameters [1] {
76- Parameter #0 [ <optional> ...$args ]
75+ Parameter #0 [ <optional> mixed ...$arguments ]
7776 }
7877}
7978Foo::method
0 commit comments