Skip to content

Exit points must behave consistently #12215

Closed

Description

@mvorisek

Bug report

I am not sure if the PHPStan error on l23/l29 is intentional or not. The l23 error mentions "return", but this is not true as "exception" is overwritten instead, and not really "overwritten" as the original exception is correctly placed into the new one as "previous exception".

In the repro the functionality of release and release2 methods is exactly the same, so this issue is to fix this inconsistency no matter what the definion of "return" (discussed above) is.

Code snippet that reproduces the problem

https://phpstan.org/r/4b8f9121-bcb3-44aa-b066-f5045a71e691

Expected output

Same PHPStan results for release and release2 methods.

Activity

  1. added a commit that references this issue on Mar 12, 2026
    225e1cd
  2. phpstan-bot commented on Mar 13, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#5163

  3. github-actions commented on Apr 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions