Re: RfC: rethink OO inheritance strictness
| From: | Marcus Boerger | Date: | Tue, 01 Aug 2006 21:41:24 +0000 |
| Subject: | Re: RfC: rethink OO inheritance strictness | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25086@lists.php.net to get a copy of this message | ||
Hello Michael,
nobody forces you to use OO if you don't like it but it is as it is. And
we cannot make it ignore its basic rules. It might be that you are lazy and
have code that would end up without problems if changing signatures at will.
However we have a bunch of situations where we cannot allow changes and that
is not only interfaces. It si also about magic functions, all that start
with __, it is about any signature that has default values or type hints or
pass by reference info. So after all where should we draw the line? Any why
just because a few people are to lazy for a few keystrokes? Come on give me
any reason why we should reinvent OOP theory and make it work. Or why we
should change to prototype OOP and make everything damn complex to
understand and break all of BC.
best regards
marcus
Friday, July 21, 2006, 10:55:05 AM, you wrote:
> Hi (Marcus),
> unfortunately I'm not very happy with the direction OO strictness takes
> in PHP. I'm sure I'm not alone and many people second this feeling.
> Precisely, let's have a look at the following:
> mike@honeybadger:~/build/php-5.2-debug$ cli -d"error_reporting=8191" -r
> 'class c{function f(){}} class d extends c{function f($a){}}'
> Strict Standards: Declaration of d::f() should be compatible with that of
> c::f() in Command line code on line 1
> mike@honeybadger:~/build/php-unicode-debug$ cli -d"error_reporting=8191"
> -r 'class c{function f(){}} class d extends c{function f($a){}}'
> Fatal error: Declaration of d::f() must be compatible with that of c::f() in Command line code
> on line 1
> I *really* think that this enforcements are no good idea and
> I _beg_ you that we leave this "area" to interfaces.
> Regards,
> --
> Michael
Best regards,
Marcus