Re: about final methods and attributes
| From: | Andi Gutmans | Date: | Sun, 22 Jun 2003 17:02:09 +0000 |
| Subject: | Re: about final methods and attributes | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-2546@lists.php.net to get a copy of this message | ||
At 11:27 AM 6/22/2003 +0200, Sebastian Bergmann wrote:
Andi Gutmans wrote: At least for consistency sake even though I think it's useless :) Consistency is the key issue here, IMHO. A typical use case for final classes and PHP might be, at some point, that a software vendor distributed his PHP application in encoded bytecode format and wants to ensure that (security) critical classes cannot change their behaviour through overriding, etc.Yeah but you can just create a remove_final($class_name) function :) Anyway, I think the real reason for final is that it allows the Java compiler to do good optimizations (i.e. get rid of virtual calls in many cases). Andi