开发者

PHP5 what is the use case of type hiting in php

function(myCar $cars)

In P开发者_JS百科HP5, type hinting is a specifying class name before object variable in a function parameters.

I know what is type hinting, but what is the exact use case in PHP5?


Have a look at the examples in the documentation:

Failing to satisfy the type hint results in a catchable fatal error.

It helps to detect errors or wrong usage of functions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜