How to use Variadic arguments to PHP 5.6 functions with Symfony 2.8?

I have a service method with variable arguments:

public function callSP($namespace, $function, ...$params) {} 

which is compiled into a container, for example:

 public function callSP($namespace, $function, $params = null) 

therefore it calls:

Strict standards note that callSP () must be compatible with XXX \ XXX \ Service :: callSP ($ namespace, $ function, ... $ params)

Unable to find any questions about this.

+8
php symfony
source share
1 answer

I suppose this problem occurs for some lazy service (listener or explicit lazy: true )

Lazy services work with the ocramius/proxy-manager library.

This library has support for variational parameters since version 2.0, which requires at least PHP 7.0.

So, I think there is no 5.6 here.

References:

+3
source share

All Articles