PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Unnecessary leading '\' in 'use' statement

Last modified: 16 May 2022

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 (php.net) for details.