I have service method with variadic arguments:
public function callSP($namespace, $function, ...$params) {}
which is compiled into container like :
public function callSP($namespace, $function, $params = null)
so it causes :
Strict Standards notice saying that callSP() should be compatible with XXX\XXX\Service::callSP($namespace, $function, ...$params)
Can't find even any questions about that.
In C programming, a variadic function adds flexibility to the program. It takes one fixed argument and then any number of arguments can be passed. The variadic function consists of at least one fixed variable and then an ellipsis(…) as the last parameter. This enables access to variadic function arguments.
PHP Function ArgumentsArguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma.
A variadic function accepts a variable number of parameters. The following example defines a function called sum() that returns the sum of two integers: <? php function sum(int $x, int $y) { return $x + $y; } echo sum(10, 20); // 30. Code language: PHP (php)
Variadic functions are functions (e.g. printf) which take a variable number of arguments. The declaration of a variadic function uses an ellipsis as the last parameter, e.g. int printf(const char* format, ...);.
I suppose, that problem occures for some kind of lazy service (listener, or explicit lazy: true
)
Lazy services are operated with ocramius/proxy-manager
library.
This library introduced support for variadic parameters since version 2.0, which requires at least PHP 7.0.
So I think there is nothing to do with 5.6 here.
Links:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With