Re: RfC: rethink OO inheritance strictness
| From: | Todd Ruth | Date: | Wed, 02 Aug 2006 15:44:09 +0000 |
| Subject: | Re: RfC: rethink OO inheritance strictness | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25135@lists.php.net to get a copy of this message | ||
Hooray! Thank you, Zeev! I'd nearly given up hope on ever moving
to a new version of php. (Actually, I'm still doomed for using $this
in static calls to an unrelated class, but every bit of avoiding
fatal errors helps.) Our code may not be OO, but it's definitely
php. ;)
Thanks,
Todd
On Wed, 2006-08-02 at 15:43 +0300, Zeev Suraski wrote:
> My recommendation:
> - Add a new flag to methods (at the implementation level) that will
> allow to flag them as 'strict'
> - In case such a strict method is improperly overridden - error out (E_ERROR)
> - In case a non-strict method is improperly overridden - emit E_STRICT
> - Consider adding userland ability to set entire classes or methods as strict
>
> Most people who use 'strict OO' will have E_STRICT enabled and have
> their code E_STRICT clean, so providing userland support for tagging
> classes/methods as strict is probably not really necessary.
>
> Zeev