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

Undefined function error even if in block guarded with function_exists(...) #3093

Open
smuuf opened this issue Oct 19, 2024 · 0 comments
Open

Comments

@smuuf
Copy link

smuuf commented Oct 19, 2024

Describe the bug
I think Intelephense should (could...?) not report a Undefined function '...' error when in block that has a function_exists(...) check around it. Honestly I'm unsure whether this is a bug report or a feature request :)

To Reproduce

<?php

if (function_exists('xdebug_break')) {
	\xdebug_break();
}

Expected behavior
I expect Intelephense not to report Undefined function 'xdebug_break'. intelephense(P1010) in the above case. (I also tried namespacing the checked function: function_exists('\\xdebug_break')), but still yields the same result.)

Note: The same result happens regardless of whether xdebug extension is actually loaded in PHP or not (phpenmod/phpdismod xdebug) - but I don't think it should matter, because the function_exists should be enough.

Screenshots
{2F25DBD7-41A6-4658-A35C-E0B105497A85}

Platform and version

  • Windows 11 + WSL2
  • PHP Intelephense v1.12.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant