Which of the following is NOT a valid way to use a namespace in PHP?

  • 'use' statement in a class
  • Global namespaces
  • Alias namespaces
  • 'namespace' declaration within a class
In PHP, there are global namespaces, and using the 'use' statement in a class allows you to access classes from those namespaces. The global namespace does exist, so Option 2 is incorrect.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *