Description
The following code:
<?php
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class Hello {
public function __construct(
public ?Closure $world = null,
) {
}
}
class Foo {
/**
* @var string
*/
#[Hello(static function() {
return null;
})]
public $bar;
}
$reflectionProperty = new ReflectionProperty(Foo::class, 'bar');
var_dump($reflectionProperty->getDocComment());
Resulted in this output:
But I expected this output instead:
string(30) "/** * @var string */"
PHP Version
Operating System
No response