I started building my code library with PHP 4. I used require_onceto import classes. Now with PHP 5.3, I come across the definition of namespaces and their import.
I want to change the source files to use importing ( usestatement) instead of using require_once. This is the right decision, I'm not sure.
I think that would be easy. Define the namespace at the top of the class files and search for and replace with other files that use them (replace require_oncewith use). In practice, what could go wrong?
And will there be a performance improvement? When you include a file, it is obvious that PHP finds the file. But when importing namespaces, this is not so obvious. Is there any performance loss when searching for namespaces and indexing them using PHP?
source
share