syntax error, unexpected fully qualified name “%s”, expecting “function”

Description

This error appears when a fully qualified name is used in the body of a class, (or any CITE).

Example

<?php

class X {
    \A\B;
}

?>

Solutions

  • Remove the standalone name.

  • Add the use keyword before the standalone name, to import a related trait.