View Single Post

  #3 (permalink)  
Old 10-19-2004
Lüpher Cypher
 
Posts: n/a
Default 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!
Reply With Quote