Skip to content

[DowngradePhp84] Downgrade exit/die with named argument #9844

Description

@samsonasik

Feature Request

Diff

-exit(status: 1);
+exit(1);

In PHP 8.4, exit or die can be marked as function call with provide named argument status

https://php.watch/versions/8.4/exit-die-as-functions

On downgrade to php 8.3, it currently doesn't remove the named argument

https://getrector.com/demo/ef539935-7ed2-4cc4-9063-dd07681260ba

On usage, it will create error:

https://3v4l.org/f0f3a#v8.3.33

So, the DowngradePhp84 rule is needed for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions