Skip to content

function_exists outside of callback does not keep knowledge of function existing #8205

@BackEndTea

Description

@BackEndTea

Bug report

if a function_exists call is used outside of a callback, it does not keep knowledge of that function existing inside of the callback.

I know this is some more 'special' code that may not happen in much projects, but i ran into this today 😅

Code snippet that reproduces the problem

https://phpstan.org/r/07fbfdd0-9f91-46bf-8a72-38aed2d5218f

Expected output

I expected no issues here

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