Inspectopedia Help

Unnecessary leading '\' in 'use' statement

Reports the use statements with an unnecessary leading \.

For namespaced names (fully qualified namespace names containing a namespace separator, such as Foo\Bar as opposed to global names that do not, such as FooBar), the leading backslash is unnecessary and not recommended, as import names must be fully qualified and are not processed relative to the current namespace.

See Using namespaces: Aliasing/Importing ( for details.

Inspection Details

Available in:

PhpStorm 2023.3, Qodana for PHP 2023.3



Last modified: 13 July 2023