Call the following class method remotely, but the number of arguments for each method is inconsistent, do not want to write dead, how to do?
class aaaController extends RpcController { public function one_function($a='', $b='', $c=''){} public function two_function($d='', $e=''){} public function three_function($f=''){}}
Reply content:
Call the following class method remotely, but the number of arguments for each method is inconsistent, do not want to write dead, how to do?
class aaaController extends RpcController { public function one_function($a='', $b='', $c=''){} public function two_function($d='', $e=''){} public function three_function($f=''){}}
Never contacted RPC, I don't know if it fits your problem.
The receive parameter in the method can be used func_get_arg ()
Version 5.6 Adds a new feature that can be used to receive variable number parameters
function concatenate($transform, ...$strings) { $string = ''; foreach($strings as $piece) { $string .= $piece; } return($transform($string));}