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