syntax error, unexpected token “,”
Description
A comma is used to separate arguments in a function call. A functioncall may also use named parameters, to identify the arguments. In this case, the name of the parameter is provided, but not its value.
Example
<?php
#[Attribute(name: , value: 1)]
class X {}
?>
Alternatives
- Remove the parameter name from the function call.
- Provide a value for the parameter name in the functioncall.
Related error messages
- [syntax-error,-unexpected-token-“,”,-expecting-“]”](syntax-error,-unexpected-token-,,-expecting-].html)
- syntax-error,-unexpected-token-“,”,-expecting-variable-or-“$”
- syntax-error,-unexpected-token-“,”,-expecting-variable