Troubleshooting "The use statement with non-compound name"
The error "The use statement with non-compound name" usually indicates that you are trying to use a namespace in a use statement, but you did not provide a compound name.
The error "The use statement with non-compound name" usually indicates that you are trying to use a namespace in a use statement, but you did not provide a compound name.
A compound name is a namespace followed by a class or function name. For example:
Example of a compound name in PHP
use \My\Namespace\MyClass;This error can also occur if you have a syntax error in your use statement. Make sure that you are using the correct syntax and that you have not left out any part of the compound name.
For example, the following use statement is missing the compound name and would trigger this error:
"The use statement with non-compound name" error in PHP
use \My\Namespace; // Missing class or function nameTo fix this error, make sure to include the class or function name in the use statement:
Fixing "The use statement with non-compound name" error in PHP
use \My\Namespace\MyClass; // Correct