Annotations on Interfaces

Code
<?php

use Doctrine\Common\Annotations\AnnotationReader;

interface Foo
{
    /**
     * @MyAnnotation(defaultValue="bar")
     */
    public function bar();
}

/**
 * @Annotation
 */
class MyAnnotation
{
    public $defaultValue;
}

$ref = new ReflectionClass('Foo');
$method = $ref->getMethod('bar');

$parser = new AnnotationReader();
// or getPropertyAnnotations to get all annotations of a property
$myAnnotation = $parser
    ->getMethodAnnotation($method, 'MyAnnotation');

echo $myAnnotation->defaultValue;
Result
bar
Used Versions
PHP 8.3, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8