Skip to content

New PHP 8.4 Syntax: new MyClass()->method() without parentheses #89

@KorvinSzanto

Description

@KorvinSzanto

new Foo()->baz() will be allowed in PHP 8.4, we should cover it in the next version of PER-CS.

To me this is similar to the question of new Foo vs new Foo() where we decided the latter was better for readability: https://github.com/php-fig/per-coding-style/blob/master/spec.md#4-classes-properties-and-methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions