Skip to content

PHP8.4: Support new without parenthesis#415

Open
dantleech wants to merge 1 commit intomicrosoft:mainfrom
phpactor:84-new-no-parens
Open

PHP8.4: Support new without parenthesis#415
dantleech wants to merge 1 commit intomicrosoft:mainfrom
phpactor:84-new-no-parens

Conversation

@dantleech
Copy link
Contributor

(from Phpactor's fork - not tested extensively)


// PHP8.4 new with no parenthesis
if ($this->getCurrentToken()->kind === TokenKind::ArrowToken) {
return $this->parsePostfixExpressionRest($objectCreationExpression);
Copy link
Contributor Author

@dantleech dantleech Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line with the rest of this libaray this should probably have a run time php_version() > 80400?

(incidentally would be good to refactor so that it didn't depend on the runtime PHP version)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for being able to configure at what PHP level the parser works

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants