getId(): int; * @param int $id public function setId(int $id);I想知道getter的返回类型以动态格式化值I想知道设置器的参数类型来动态初始化它.
我需要这样做,因为属性不是初始化的,因为它们是对象类型的,它们的实际值在接口中。protected function getParamTypeValue
有什么好的方法来使用(可能的)未定义变量(比如外部输入)作为可选的函数参数?foo($a,$b); //output: 1
$r = new ReflectionFunction('foogetDefaultValue(); //still would have to check if $b is already se