Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault in ReflectionProperty::__toString() when default value is an enum #8444

Closed
nicolas-grekas opened this issue Apr 26, 2022 · 0 comments

Comments

@nicolas-grekas
Copy link
Contributor

Description

The following code:

<?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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants