Re: Re: PHP5 silently throwing exceptions???
| From: | Gerard Samuel | Date: | Mon, 17 Jan 2005 20:01:05 +0000 |
| Subject: | Re: Re: PHP5 silently throwing exceptions??? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206580@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
Jason Barnett wrote:__autoload() *is* a bit quirky. And I agree its not a catchall handler. So far its not too bad, but I'll see as time progresses.Gerard Samuel wrote:...I haven't checked the source on this one so I can't guarantee that what I've said above is true, but I believe it to be true. Someone correct me if I'm wrong (wouldn't be the first time ;)seems to me like you 'on the money'. I just wanted to add that IMHO use of __autoload() is over rated (too much magic is not alway a good thing) in the general case, i.e. use it for specific types of classes like dataobject classes that are generated on the fly - but don't use it as a catchall handler
If you are using Exception classes and other 'framework' type classes then I would suggest that a set of require_once statements in a global file will: a, suffice b, make things more managable (i.e. includes are explicit) if there is a speed issue with not using __autoload() then it might still be worth only implementing __autoload() for general/all cases if: a, sqeezing out a few microseconds is _really_ needed b, your client (if you have one!) is willing to compensate you for the countless hours of code profiling and speedmeasuring required to increase speed thru optimization ;-)