Re: [RFC] Function autoloading through spl_autoload*

From: Date: Mon, 15 Aug 2011 07:15:44 +0000
Subject: Re: [RFC] Function autoloading through spl_autoload*
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-54614@lists.php.net to get a copy of this message
2011/8/15 Stas Malyshev <smalyshev@sugarcrm.com> > Hi! > > > On 8/14/11 11:21 PM, Sebastian Krebs wrote: > >> I already made an suggestion [1], that bypass this. >> > > That suggestion means you can not autoload namespaced function that > overrides global function. Major WTF. Imo overriding built-in functions is a WTF... Confusing others by changing the behaviour of well-known functions just sounds scary. However, when you really want to do this, than you can load your functions like before > Also leads to two autoload calls (one most probably resulting in exhaustive > include path search) when autoloading a non-namespaced function. Pretty bad > idea IMO. Please read my other mail completely: - Developers will get used to namespace everything of their stuff to avoid name conflicts (_exactly_ like it is for classes already) - Usually more than one function is loaded at once, thus you will probably safe other autoloader-calls later on. This means, there will be two calls to the autoloader _only_ when the function does not exists at all. In this case you have other problems than the two calls. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#54614) next »