[php-src] Issue #20895: ReflectionProperty does not return the PHPDoc of a property if it contains an attribute with a Closure

[email protected] (zavarock)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/20895
Author: zavarock

### Description

The following code:

```php
<?php
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class Hello {
    public function __construct(
        public Closure $world,
    ) {
    }
}

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:
```
bool(false)
```

But I expected this output instead:
```
string(30) "/** * @var string */"
```


### PHP Version

```plain
PHP 8.5.0
```

### Operating System

_No response_
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.