...Annotations in Doctrine are used for the ORM configuration to build the class mapping, but it can be used in other projects for other purposes too. You can install the Annotation component with composer. The access to the annotations happens by reflection of the class containing them. There are multiple reader-classes implementing the Doctrine\Common\Annotations\Reader interface, that can access the annotations of a class. A common one is Doctrine\Common\Annotations\AnnotationReader. Note that AnnotationRegistry::registerLoader('class_exists') only works if you already have an autoloader configured (i.e. composer autoloader). Otherwise, please take a look to the other annotation autoload mechanisms.