Re: Why change require_once? A brief explanation of motives

From: Date: Tue, 17 Jul 2007 14:23:17 +0000
Subject: Re: Why change require_once? A brief explanation of motives
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47563@lists.php.net to get a copy of this message
Matthew Weier O'Phinney wrote:
* Trades one known and widely used language construct, require_once, for another, autoloading; * with the purpose of saving 15% of a fraction of the execution overhead; * and solving an edge case of installation (phar); * and making tracking down *where* and *when* a class file is loaded much more difficult.
you are missing: more flexibility in loading code. let me give you an example: you may have libs installed in all sorts of places, your include path now contains 5-6 paths and the more paths you have, the longer the loading will take. now by allowing a more flexible loading mechanism, you can get rid of traversing the include path and instead add some smarter logic to quickly identify the path to load the code from. another example would be preventing fatal errors by creating classes on the fly. etc. there are tons of reasons why it might be useful. regards, Lukas

« previous php.pear.dev (#47563) next »