I\'ve heard the latest PHP has support for namespaces. I know variables defined in the global scope have no namespace, so how does one make a variable in a different na
A namespace allows you to organize code and gives you a way to encapsulate your items.
You can visualize namespaces as a file system uses directories to group related files.
Basically namespaces provide you a way in which to group related classes, functions and constants.
They also help to avoid name collisions between your PHP classes/functions/constants, and improve the code readability, avoiding extra-long class names.
Example namespace declaration: