Hi SonarSource team,
We’ve recently encountered what appears to be a recurring false positive with PHP rule S1144 (“Unused private methods should be removed”) when using first-class callables.
This issue was originally reported back in August 2023 and was confirmed as a false positive by you:
-
Sonarqube Developer Edition 2026.4.1
-
Original community report: PHP S1144 – False positive first-class callable
-
Related ticket: SONARPHP-1440
-
Merged fix: sonar-php PR #1110
As far as we understand, this issue was fixed in August 2023 with PR #1110.
However, we’re still encountering a case where private methods referenced through first-class callable syntax are incorrectly flagged as unused.
It seems that the detection does not work consistently across all scenarios, or the issue may have been reintroduced.
Example
We’ve encountered the following case in our codebase:
Example – False positive
[screenshots: Code example showing a private method incorrectly flagged by S1144]
The affected method is referenced and used through first-class callables, so they should not be considered unused.
Expected behavior
Private methods referenced via PHP’s first-class callable syntax should be recognized as used and should not trigger rule S1144.
Actual behavior
SonarQube reports these methods as unused, even though they are referenced through first-class callables.
Question
Could you please take another look at this issue?
Is this a known regression, or are there still specific scenarios involving first-class callables that are not fully covered by the original fix?
We’d appreciate any feedback on whether this is already being tracked or if a new ticket should be created.
Thanks in advance for your help!

