News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Propel Blog:
The End of Autoloading
March 25, 2011 @ 11:13:51

On the Propel blog there's a recent post talking about how the age of autoloading might be ending and how namespacing could be the next logical step (or could it).

Autoloading in PHP is a great time saver. It lets you write concise scripts without the knowledge of the exact directory structure of the libraries you use. But with the arrival of namespaces in PHP 5.3, and the influence of Java over new generation PHP frameworks, autoloading is changing. In the near future, explicit autoloading will be ubiquitous, but with none of the advantages of the old style autoloading.

He talks about "the old days" when things were included manually through file paths, how that graduated to the SPL autoloading and, most recently, up to namespace autoloading. He shares code samples of how the namespace loading works and how you can abuse it to override current classes/functionality with your own. He points out one interesting correlation though - that the "use" keyword seems a lot like the "require_once" of way back when. He shows how the added verbosity of namespace usage can be a hinderance on frameworks, citing microframeworks specifically and showing one implementation that's non-namespaced next to another that is.

0 comments voice your opinion now!
autoloading namespace requireonce use spl


blog comments powered by Disqus

Similar Posts

Make Me Pulse Blog: PHP6, Unicode and TextIterator features

MaltBlue.com: Painless Data Traversal with PHP FilterIterators

Padraic Brady's Blog: Namespaces (or Yet Another Pointless Opinion Piece)

Adam Trachtenberg's Blog: PHP Trivia Contest: DOM + Default Namespaces

Adam Trachtenberg's Blog: PHP Trivia Contest: DOM + Default Namespaces


Community Events





Don't see your event here?
Let us know!


series deployment release language conference laravel threedevsandamaybe community tips interview developer introduction api framework zendserver development symfony podcast list code

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework