Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic string is not callable after check with function_exists #1849

Closed
luxemate opened this issue Jan 26, 2019 · 4 comments
Closed

Dynamic string is not callable after check with function_exists #1849

luxemate opened this issue Jan 26, 2019 · 4 comments

Comments

@luxemate
Copy link

luxemate commented Jan 26, 2019

Summary of a problem or a feature request

If dynamic string is checked with function_exists it still is considered as not callable. While checking it with is_callable works.

Is it a bug or an existing function may somehow not be callable?

Code snippet that reproduces the problem

Trying to invoke string but it might not be a callable.
https://phpstan.org/r/dff90463-0f69-409a-ba59-fb242a09a13e

Expected output

No errors.

@ondrejmirtes
Copy link
Member

Yeah, this is not currently supported, you can just use is_callable :)

@phpstan-bot
Copy link
Contributor

@luxemate After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-12: Trying to invoke string but it might not be a callable.
+12: Trying to invoke non-empty-string but it might not be a callable.
Full report
Line Error
12 Trying to invoke non-empty-string but it might not be a callable.

@ondrejmirtes
Copy link
Member

Implemented: phpstan/phpstan-src@4a98863

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants