Skip to content

array_first is not reported as function.notFound in PHP 8.4 #15150

Closed

Description

@Kleisli

Bug report

When i use the function array_first in a PHP 8.4 code base, PHPStan doesn't report it as non existing anymore.

I was able to track the bug down to version 2.1.32 (in 2.1.31 function.notFound still is reported), but the bug exists up to the latest version 2.2.12

I was not able to reproduce the behaviour in the playground, I don't know what version you deployed there...

Code snippet that reproduces the problem

Should report like in the playground, but it doesn't

Expected output


228 Function array_first not found.
🪪 function.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols


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

not today, but PHPStan made my code so much better. :)

Activity

  1. mergeable commented on Sep 1, 2026

    @mergeable

    This bug report is missing a link to reproduction at phpstan.org/try.

    It will most likely be closed after manual review.

  2. Kleisli commented on Sep 2, 2026

    @Kleisli
    Author

    I added the link to the working playground example, but this doesn't work with PHPStan on any version from 2.1.32 upwards

  3. staabm commented on Sep 2, 2026

    @staabm
    Contributor

    please try phpstan bisect to find the regression commit: https://phpstan.org/user-guide/command-line-usage#bisecting-regressions

  4. Kleisli commented on Sep 2, 2026

    @Kleisli
    Author

    @staabm cool feature!

    This is the commit phpstan/phpstan-src@230e9ee
    Maybe because it adds the polyfill for PHP8.5

    But I also found phpstan/phpstan-src#4499 - and it seems this behavior might be on purpose.

  5. added this to the Easy fixes milestone on Sep 2, 2026
  6. phpstan-bot commented on Sep 2, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#6351

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

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

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions