I'm sure others can give you a better description, but in a nutshell, namespaces are essentially a way in which to cipher of various code into namespaces. Think of a namespace as a category. Therefore anything in that category can have the same function name as another function in a different namespace (or category).
Basically, when you and others develop a PHP script now, you'll see you have to append some text that identifies your script to each class you create for that script, but with namespaces you can place all your classes in a namespace and all the classes within there can be named whatever you like, because they won't conflict with anything else.
Welcome back to TalkPHP by the way It's a pleasure to have you round again!
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
The Following User Says Thank You to Wildhoney For This Useful Post:
Correct me if I am wrong, but from my very limited understanding, it appears to give classes their own level of scope. PHP classes were totally global before. This meant that if you named your class something like getUserName, no one else could in a large project. Namespaces will allow duplicate class names to happen in instances where more than one library in a project might have similar functionality. Before, one would have to append some sort of unique prefix to the class name in order to insure its uniqueness. This could have resulted in very long class names.
"Why is it drug addicts and computer aficionados are both called users?" -Clifford Stoll
namespaces can be used to help you organize your classes. More importantly, namespaces help programmers aviod name clashes and stupidly long class names (if we were to prefix class names to stop clashing) like this: