[php-src] Issue #22860: ReflectionProperty::hasDefault return false on promoted property
| From: | Norbytus | Date: | Wed, 22 Jul 2026 15:11:02 +0000 |
| Subject: | [php-src] Issue #22860: ReflectionProperty::hasDefault return false on promoted property | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252471@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/22860
Author: Norbytus
### Description
The following code:
```php
<?php
class A {
function __construct(
public string $value = '',
) {
}
}
$propInfo = new ReflectionProperty('A', 'value');
var_dump($propInfo->hasDefaultValue());
```
bool(false)
```
```
bool(true)
```
```
### PHP Version
```plain
PHP 8.4.20 (cli) (built: May 25 2026 09:46:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.20, Copyright (c) Zend Technologies
```
### Operating System
archlinux 2026.07.01