Re: defining a class/instantiating object inside a method of anotherclass
Berislav Lopac wrote:
> On Tue, 19 Oct 2004 04:07:11 GMT, Lüpher Cypher wrote:
>
>
>>Taking the whole thing outside of the class definition is not going to
>>work - suppose I have many subclasses of this class, each with its own
>>file, then for every class I'd have to provide a separate function
>>outside the class definition to read the file.
>
>
> No, just include the class definition file anywhere, even inside the
> function block. As PHP is parsed and compiled before it's executed, class
> definitions are valid for whole program, regardless of where they are
> defined.
>
Cool, I didn't know that. Thanks!
|