Phpinspectionsea: ParameterByRefWithDefaultInspection missleading / needs clearification

Created on 26 Jul 2017  路  3Comments  路  Source: kalessil/phpinspectionsea

Screen:

image

Given the following function:

function someFunc($first, &$byRef = null)
{
}
someFunc('foo');

The warning is resolved when the default value is removed:

function someFunc($first, &$byRef)
{
}
someFunc('foo');

This in case leads to an PHP fatal error:

PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function someFunc(), 1 passed in file.php on line 7 and exactly 2 expected in file.php:3
bug / false-positive duplicate

All 3 comments

I dropped the inspection completely in the upcoming 2.3.9: https://github.com/kalessil/phpinspectionsea/commit/902c756fef4ee606976f2cbafcd3de0bbc97bf4a - causes similar problems in real projects.

Ahh my bad, should have searched the repo a bit better. Anyway thanks for your very fast response :1st_place_medal:

No problems, I'm ok for me =)

Was this page helpful?
0 / 5 - 0 ratings