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

Dies in a heap on encountering "new without parens" #8911

Closed
Bilge opened this issue Nov 25, 2024 · 8 comments
Closed

Dies in a heap on encountering "new without parens" #8911

Bilge opened this issue Nov 25, 2024 · 8 comments
Labels

Comments

@Bilge
Copy link

Bilge commented Nov 25, 2024

Bug Report

Subject Details
Rector version 1.2.10

"Syntax error, unexpected T_OBJECT_OPERATOR, expecting ')', Syntax error, unexpected ','"

Minimal PHP Code Causing Issue

class C {
  function F() {}
}

new C()->F();

Expected Behaviour

Do not die in a heap.

@Bilge Bilge added the bug label Nov 25, 2024
@TomasVotruba
Copy link
Member

Thank you for your report!

We'll need an isolated failing demo link from: http://getrector.com/demo,
that way we can reproduce the bug.

@Bilge
Copy link
Author

Bilge commented Nov 25, 2024

I don't think your demo tool emits errors produced by Rector dying.

@TomasVotruba
Copy link
Member

TomasVotruba commented Nov 25, 2024

Indeed, but your code passes without error: https://getrector.com/demo/60b18f6e-b763-4579-a458-d2b0b48f56b6

What is your local PHP version?

@Bilge
Copy link
Author

Bilge commented Nov 25, 2024

PHP 8.4.1 (cli) (built: Nov 20 2024 11:13:29) (ZTS Visual C++ 2022 x64)

@TomasVotruba
Copy link
Member

This will be most likely fixed in #8815

@samsonasik
Copy link
Member

Resolved on latest dev-main with php-parser 5.

@Bilge
Copy link
Author

Bilge commented Nov 26, 2024

@samsonasik Thanks. When will this be released?

@samsonasik
Copy link
Member

see #8815 (comment)

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

No branches or pull requests

3 participants