문제

In php, why do people sometimes have things like

param mixed $value

as comment in their code (usually found in Object-Oriented PHP)? When should you write that yourself and how exactly should you use it?
Thanks!

도움이 되었습니까?

해결책

It's used by IDEs to auto-generate tooltips and documentation, usually based on Javadoc.

다른 팁

It is written to be used with documentation generation tools and with IDEs autocompletion.

mixed means it can accept several data types of the param.

It's a standardized way of formatting comments. You can read more about it here: http://www.phpdoc.org/about

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top