Understanding changes in namespaces
The concept of a namespace was introduced in PHP 5.3 as a means of isolating hierarchies of classes. Unfortunately, the original algorithm that was used to parse namespace names had several flaws. In addition to being overly complicated, the way in which namespace and class names were tokenized internally was performed in an inconsistent manner, leading to unexpected errors.
Before we get into the benefits and potential backward compatible breaks, let's have a look at how the namespace tokenization process has changed.
Discovering differences in tokenization
The tokenization process is an important part of the interpretation process and takes place when your PHP code is executed. In the process of producing byte code, the PHP program code is broken down into tokens by the PHP parsing engine.
The following table summarizes namespace tokenization changes: