Skip to content

Returning by ref + finally allow circumventing return type checks #13338

Closed

Description

@staabm

Bug report

see also php/php-src#18736

just leaving it here as I just saw the issue beeing fixed on php-src.
as its a by-ref thing I think its pretty low priority

Code snippet that reproduces the problem

https://phpstan.org/r/bc16a826-db40-4b2c-8360-928ee0d5ea49

Expected output

Fatal error: Uncaught TypeError: test(): Return value must be of type int, string returned

Did PHPStan help you today? Did it make you happy in any way?

No response

Activity

  1. phpstan-bot commented on Sep 8, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#6393

  2. github-actions commented on Oct 10, 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.

  3. locked as resolved and limited conversation to collaborators on Oct 10, 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