psalm icon indicating copy to clipboard operation
psalm copied to clipboard

False UnusedFunctionCall error

Open DKhalil opened this issue 10 months ago • 3 comments

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

DKhalil avatar Apr 05 '24 11:04 DKhalil

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

psalm-github-bot[bot] avatar Apr 05 '24 11:04 psalm-github-bot[bot]

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

kkmuffme avatar Apr 06 '24 11:04 kkmuffme

Opened: #10887

DKhalil avatar Apr 08 '24 06:04 DKhalil