[php-src] Issue #8444: segfault in ReflectionProperty::__toString() when default value is an enum
| From: | nicolas-grekas | Date: | Tue, 26 Apr 2022 23:06:39 +0000 |
| Subject: | [php-src] Issue #8444: segfault in ReflectionProperty::__toString() when default value is an enum | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241271@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8444
Author: nicolas-grekas
### Description
The following code:
```php
<?php
enum Foo
{
case bar;
}
class Bar
{
public Foo $enum = Foo::bar;
}
$c = new Bar;
echo new \ReflectionProperty($c, 'enum');
```
Resulted in a segfault on PHP 8.1.
Resulted in this on PHP 8.2, which is also wrong:
Property [ public Foo $enum = callable ]
I'd expect the AST to be dumped instead (see #7540).
### PHP Version
PHP 8.1+
### Operating System
_No response_