Re: RfC: rethink OO inheritance strictness
| From: | Richard Quadling | Date: | Fri, 21 Jul 2006 10:27:52 +0000 |
| Subject: | Re: RfC: rethink OO inheritance strictness | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24816@lists.php.net to get a copy of this message | ||
Shouldn't be necessary. As there are 2 different methods, they should
be allowed different parameter signatures. If you want to extend a
method but hide original implementation, you can't change the
parameter signature. I'm on the opposite side of the fence to you it
seems!
On 21/07/06, Soenke Ruempler <ruempler@topconcepts.com> wrote:
Derick Rethans <mailto:derick@php.net> wrote on Friday, July 21, 2006 11:31 AM: To be compatible, the only thing you have to do is adding standard values to derived methods' parameters: $ php -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 2 $ php -d"error_reporting=8191" -r 'class c{function f(){}} class d extends c{function f($a = null){}}'; $ [no error] This behaviour makes sense to me. -soenke -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php-- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"