php注解


 官方全部注解:https://docs.phpdoc.org/references/phpdoc/tags/index.html

1.@var 您可以使用@var标记来记录属性的“类型”,有时也称为类变量。

语法 
@var [“Type”] [$ element_name] [<description>]  //type 数据类型   $element_name 域名称 description 描述

实例

class Foo  /单个域
{ 
  / ** @var string | null应包含描述* / 
  protected $ description = null; 
}
class Foo //多个域在一起
{
  /**
   * @var string $name        Should contain a description
   * @var string $description Should contain a description
   */
  protected $name, $description;
}

 


 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM