-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
AST->string does not reproduce constructor property promotion correctly #17101
Comments
Discovered via the Also fails with other promoted modifiers, like asymmetric visibility |
Yeah this is definitely a bug, likely overlooked because anonymous classes are the only way you can print a function that has a promoted property as argument. |
The fix for the visibility is simple, but the hooks are also not outputted so I'll try to tackle that too. |
Another bug: the hook type is incorrect in AST printing for the following case: assert(false && new class {
public $prop { set => $this->prop = 1; }
}); |
Fixed in php#17101
Description
The following code:
Resulted in this output:
But I expected this output instead (note the
public
in the constructor property)See https://3v4l.org/rM9Hi
PHP Version
PHP 8.2+
Operating System
No response
The text was updated successfully, but these errors were encountered: