Re: ZE2 + public/protected/private/final
| From: | (Marcus Börger) | Date: | Thu, 28 Nov 2002 17:25:59 +0000 |
| Subject: | Re: ZE2 + public/protected/private/final | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91876@lists.php.net to get a copy of this message | ||
With current ZE2 it is possible to instanciate an abstract class. That is a class
that has at least one abstract method. When we add a flag field to class_entry
struct we can handle this. We simply need to set an abstract flag for the class
entry when any abstract method is added or inherited.
I updated the full patch to do it that way:
http://marcus-boerger.de/php/ext/ze2/ze2-f3p-21128.diff.txt
marcus
At 18:10 25.11.2002, Marcus Börger wrote:
After Andi had commited some cleanups my version from PPP is a bit smaller. My version is of cause only my private idea of implementing PPP. The solution i went on has some advantages and disadvantages. One of the disadvantage is that i do not allow redeclaring of private member functions. On the other hand and from my current perspective this should allow a faster implementation. But especially here i would appreciate every hint for alternatives. Besides public/protected/private i introduced final which is available as a smaller patch without public/protected/private stuff. Final can be used if you do not want anybody to modify (overload) one of your methods. The implementation is very simple since only one new keyword "final" is used which can be stored in fn_flags of methods. While inheriting there needs to be one additional check: A final function cannot be redeclared. And i added two compiler errors in the language parser to have better messages when someone tries to declare a method final and abstract. The main disadvantage here is that final needs the a keyword. You can download updated patches and test files here: http://marcus-boerger.de/php/ext/ze2 Comments welcome !!! -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php