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

BUG - Wrong inspection report of Callable parameter usage violates definition for PHP: abs() #1966

Open
Nemolicious15 opened this issue Dec 13, 2024 · 0 comments

Comments

@Nemolicious15
Copy link

Nemolicious15 commented Dec 13, 2024

Subject Details
Plugin Php Inspections (EA Extended) v5.1.0
Language level PHP8.4 until PHP5.6 same issue (no older versions tested)

Current behaviour

Using the pure PHP Abs function with an integer argument shows the wrong EA inspection report when the output of that abs call is used to assign to an integer, but fine when returned directly. It seems it defaults to thinking value returned is a float when the assignment is done, however the instruction does a hard typed int = abs(int). Please see attached screenshots.

Issue window view
image

Issues tab view with line number ref visible
image

Expected behaviour

No inspection issue report should be shown when doing int = abs(int), as it is clear it is an integer returned and assigned to another integer.

Environment details

PhpStorm 2024.3, MacBook Air M1 2020, MacOS Sequoia v15.1.1 16GBRAM

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