1.2.394. Duplicate Named Parameter¶
Two parameters have the same name in a method call. This yields a Fatal error at execution time.
<?php
function foo($a, $b) {}
// parameters are all distinct
foo(a:1, b:2);
// parameter a is double
foo(a:1, a:1);
?>
See also https://www.php.net/manual/en/functions.arguments.php.
1.2.394.2. Connex PHP features¶
1.2.394.2.1. Suggestions¶
Review the parameters names and remove the duplicates
Review the parameters names and makes the names unique
1.2.394.2.2. Specs¶
Short name |
Functions/DuplicateNamedParameter |
Rulesets |
|
Exakat since |
2.2.3 |
PHP Version |
With PHP 7.0 and older |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Note |
This issue may lint but will not run |
Available in |