我正在使用PHPdocs阅读本文 :
数据类型应该是有效的PHP类型(int,string,bool等),“这很好,但是它们没有说明用于识别其他类型的字符串(例如int,string,bool)。
我在GUESSING他们使用(强制转换)语法来确定用于注释的类型,但像PHP中的浮点这样的东西没有一个强制转换操作符,所以我不知道该用什么。 也许它是漂浮的,或者也许它是fp。
有没有人有PHP的基本类型的确定列表,以及在PHPdocs中应该用什么字符串来识别它们?
I'm on PHPdocs Reading this :
The datatype should be a valid PHP type (int, string, bool, etc)," which is fine, but they don't say which strings (such as int, string, bool) to use to identify the other types.
I'm GUESSING they use the (cast) syntax to determine the type to be used for the annotations, but something like floating point in PHP doesn't have a cast operator for it so I'm not sure what to use for that. Maybe it's float, or maybe it's fp.
Does anyone have a definitive list of the basic types in PHP and what string should be used to identify them in your PHPdocs?
最满意答案
它全部列在文档中: http : //phpdoc.org/docs/latest/references/phpdoc/types.html
对于浮点数,关键字是(逻辑上) float 。
It's all listed in the documentation: http://phpdoc.org/docs/latest/references/phpdoc/types.html
For floats, the keyword is (logically enough) float.
更多推荐
发布评论