Re: Re: [PHP4BETA] Bug: Isn´t it possible to use require /include to add methods to classes????
| From: | André Langhorst | Date: | Fri, 12 May 2000 10:49:07 +0000 |
| Subject: | Re: Re: [PHP4BETA] Bug: Isn´t it possible to use require /include to add methods to classes???? | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14894@lists.php.net to get a copy of this message | ||
I dit not know that it is not possible to require inside classes outside methods.
Disallowing include() would make sense, but why don´t allow require. What if you need a set of functions in many classes, of course I could put that function in another class and let the one extend the other, but multiple extends aren´t suported in php and if I need another extension I´ll have to modify the whole code and to keep my functions all together. I can´t call it from outside because of another issue I´ve posted, that variable references aren´t supported for variable functions.
And before using eval() I´ll cut&paste the code in every class.
Am I wrong or could this be a nice extensions. Another function which works like require() before the whole script is parsed replacing itselft entirely with another file....
André