i have function like this.
function load($name, $arg1, $arg2, $arg3, $arg4){
$this->$name = new $name($arg1, $arg2, $arg3, $arg4);
}
the load() method will load some class and set it as class property and the infinite arguments, depend in the class they assigned.
another example if i only set method $this->load with 3 argument, the this what will happen in the process
function load($name, $arg1, $arg2){
$this->$name = new $name($arg1, $arg2);
}
it is possible do something like that?
You can use combination of
func_get_args(),ReflectionClassand the help of this comment like this: