Skip to content

Account for E_USER_ERROR halting execution #5992

@mind-bending-forks

Description

@mind-bending-forks

The error produced in the following minimal example is a false positive:

https://phpstan.org/r/268a8b6e-6339-47f3-97e9-57fdf660aa90

This is because when E_USER_ERROR is used in conjunction with trigger_error, it results in execution being halted. Therefore it is functionally equivalent to:

https://phpstan.org/r/7244be86-a3e4-42ba-94ac-9ae611128f5b

It would be great if phpstan could recognise that trigger_error with E_USER_ERROR halts execution, so as to avoid producing false positive error messages like the one above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions