Re: Re: [Zend Engine 2] RE: [PHP-DEV] REPOST: Class Autoloading [PATCH]
| From: | Ivan Ristic | Date: | Thu, 13 Jun 2002 18:00:37 +0000 |
| Subject: | Re: Re: [Zend Engine 2] RE: [PHP-DEV] REPOST: Class Autoloading [PATCH] | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-85197@lists.php.net to get a copy of this message | ||
> > > The second problem is that I don't see it working with nested classes.
> > > Is it good enough to only have this work with classes in the global
scope?
> >
> > I am not really familiar with nested classes; is it because
> > you don't know the name of the file in which a nested class
> > is located? If so, I would say that trying to accommodate that
> > would be an overkill. In any case, the programmer using nested
> > classes can always write the __autoload() function that will
> > be smart enough.
>
> The problem is that if you have MyClass1::MyClass2::MyClass3 then MyClass3
> is looked up in the result of MyClass2 being looked up in MyClass1. If the
> lookup fails I can't tell __autoload() the path. The only think I could do
> is possibly pass it the result of MyClass2 being looked up in MyClass1 and
> "MyClass3". The question is if people will manage to handle this. I think
> it might be complicated and it might be best not to go in this direction.
I see the problem. But I would also like to play with it to
understand it better. Why don't you add the feature so that we
can test it, and we will remove it later if it prooves unusable?
--
Ivan Ristic, ivanr@webkreator.com
[ Weblog on PHP, Software development, Intranets,
and Knowledge Management: http://www.webkreator.com ]