1.2.389. 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 Function arguments.

1.2.389.2. Connex PHP features

1.2.389.2.1. Suggestions

  • Review the parameters names and remove the duplicates

  • Review the parameters names and makes the names unique

1.2.389.2.2. Specs

Short name

Functions/DuplicateNamedParameter

Rulesets

All, Analyze, Changed Behavior, LintButWontExec

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

Entreprise Edition, Exakat Cloud