phpinspectionsea
phpinspectionsea copied to clipboard
Type casting shouldn't recommend `(int) $var` over `intval($var)` anymore
Description (screenshot):
This inspection shouldn't be as "aggessive" as stroke the function as since php8.0 (at least) intval() (and similar type casting methods) are now faster than (or on par with) (int) $var syntax.
Example
Simple benchmark on lots of iteration to make results clear : https://3v4l.org/8fXUh
Thank you for reporting @etshy!
With all improvements in PHP core since inspection was introduced, we can update the reporting to weak warning and move it into code style group. We will make the necessary changes as soon as capacity allows.
A weak warning about code style seems good to me.