Unexpected character in input: '\’ (ASCII=92)

Description

This linting error appears at linting time, until PHP introduced namespaces, whose separator is \. Then, it was added to the recognized characters.

Example

<?php

    use \A\B as C;

?>

Solutions

  • Upgrade to PHP 5.3 or later.

  • Replace the backslash by an underscore.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See ` <https://php-changed-behaviors.readthedocs.io/en/latest/behavior/.html>`_.