Annotations in PHP: They Exist

About PHP

Annotations are more than PHPDoc comments. Annotations are a fully-featured way of including additional information alongside your code.

Annotations in PHP: They Exist from Rafael Dohms

PHP: rfc:annotations

Many languages currently support metadata information. This RFC exposes an idea about how can it be implemented in PHP, providing a powerful tool that many applications can take advantage of.

The Annotation Example



/** @return*/
class TestClass

$rc = new ReflectionClass('TestClass');
var_dump($rc->getDocComment()); // string(13) "/** @return*/"
I Agree and Close We would like to use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We would like to share also information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them or they’ve collected from your use of their services. See details