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

Description

In this case, PHP found two identifiers in a row: X and Y. This never happens in PHP code. Either a keyword should have separated them, or one of them is a duplicate.

Example

<?php

class X Y {}

enum E Z {}

interface I W {}

?>

Solutions

  • Add a missing keyword between the two identifiers: here, implements or extends could work.

  • Remove one of the duplicate name.