Namespace Basics
Namespaces allow organizing code into logical groups and prevent name conflicts.
They are especially useful in large applications and libraries.
Declaring a Namespace
Section titled “Declaring a Namespace”namespace App;
class User { public function sayHello() { echo "Hello"; }}Using the Class
Section titled “Using the Class”$user = new \App\User();$user->sayHello();