syntax error, unexpected variable “$%s”, expecting “)”¶
Description¶
In a function, method or closure signature, each parameter must be separated from the next one by a comma. Here, the comma between $a and $b is missing, so once PHP has parsed $a as a complete parameter, it expects either another comma or the closing parenthesis of the argument list; instead it finds another variable.
Example¶
<?php
function foo($a $b) {}
?>
Literal Examples¶
syntax error, unexpected variable “$b”, expecting “)”
Solutions¶
Add the missing comma between the two parameters.
Remove the extra variable if it was left over from editing.
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>`_.