Duplicate parameter name $%s for function %s%s%s()

Description

It is not allowed to have several times the same parameter in a method, closure or function signature. All the parameters must have different names.

This error appears only in PHP debug mode.

Example

<?php

function foo($a, $a, $a) {}

?>

Literal Examples

  • Duplicate parameter name $a for function foo()

Solutions

  • Remove the parameters with duplicate names.

  • Rename the parameters with duplicate names.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See ` <https://php-changed-behaviors.readthedocs.io/en/latest/behavior/.html>`_.