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 {}

?>

Solutions

  • Remove the parameter name from the function call.

  • Provide a value for the parameter name in the functioncall.