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

False UnusedFunctionCall error #10882

Open
DKhalil opened this issue Apr 5, 2024 · 3 comments
Open

False UnusedFunctionCall error #10882

DKhalil opened this issue Apr 5, 2024 · 3 comments

Comments

@DKhalil
Copy link
Contributor

DKhalil commented Apr 5, 2024

This shouldn't throw a UnusedFunctionCall error: https://psalm.dev/r/6a2fe4fa74

Copy link

I found these snippets:

https://psalm.dev/r/6a2fe4fa74
<?php
  
$parser = xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
Psalm output (using commit ef3b018):

ERROR: UnusedFunctionCall - 4:1 - The call to xml_parser_set_option is not used

ERROR: UnusedFunctionCall - 5:1 - The call to xml_parser_set_option is not used

ERROR: UnusedFunctionCall - 6:1 - The call to xml_parser_set_option is not used

@kkmuffme
Copy link
Contributor

kkmuffme commented Apr 6, 2024

Please add it to psalm dictionaries/ImpureFunctionsList.php as impure function and create a PR

@DKhalil
Copy link
Contributor Author

DKhalil commented Apr 8, 2024

Opened: #10887

orklah added a commit that referenced this issue Apr 28, 2024
Add XML functions to ImpureFunctionsList #10882
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

2 participants