PHP Specify the Return Type Hints for a Method

后端 未结 5 1112
庸人自扰
庸人自扰 2021-01-07 23:18

What is the correct syntax for me to specify the return type hints for a method?

For example, I have such a method:

private static function Construct         


        
5条回答
  •  轮回少年
    2021-01-07 23:45

    PHP doesn't support type hinting on return types. Perhaps you should add a documentation block declaring the return type and maybe your IDE will pick that up (I don't know if it will or not).

提交回复
热议问题