syntax error, unexpected identifier “%s”, expecting “]”

Description

PHP found two identifiers next to each other. This happened inside an attribute declaration.

Example

<?php

#[A name:a)]
class X {}

?>

Solutions

  • Close the attribute with a closing square bracket. The following code needs to be updated too.

  • Open the argument part of the attribute, with an opening parenthese.