Search code examples
phpphpdoc

$ character on PHPDoc @property declaration


In some places the name of a @property declaration using PHPDoc have $ sign such as:

/**
 * @property string $mystring
 */

But in other places the name appears without the $ sign such as:

 /**
  * @property string mystring
  */

PHPStorm makes no apparent difference between both, and the documentation here just says '[name]', so I'm wondering what is the correct way if there is any.


Solution

  • The example given here has the $ so I'd use the dollar.

    Also, php annotations should start with /** (double *)