Unknown named parameter $%s

Description

Named parameters are the parameters of the function, or method. Their actual name is the name of the variable, without the leading $ sign.

With named parameters, the case is important, just like with variables.

Example

<?php

function foo($a, $b) {}

foo(c: 1);

?>

Literal Examples

  • Unknown named parameter $c

Solutions

  • Check the case of the parameter.

  • Check the signature of the method to see if that parameter actually exists.

  • Add the parameter to the method signature.

  • Remove the name in the method call, and rely on positional arguments.