On Mon, Sep 19, 2011 at 11:55 AM, Gustavo Lopes <glo...@nebm.ist.utl.pt> wrote:
> Em Mon, 19 Sep 2011 10:35:47 +0100, Ferenc Kovacs <tyr...@gmail.com>
> escreveu:
>
>> could you check my second(lengthy) mail on this thread?
>> I also tried to come up with the valid, and invalid signature changes.
>> I forget to take references into account, so thanks for pointing that out.
>>
>
> I mostly agree with you, with these exceptions:
>
> * No catchable fatal error -- E_STRICT or E_NOTICE.
Ok, from the responses, I changed my mind already about the fatal.

> * There's no reason checking typehints contravariance would be particularly
> difficult.

we discussed this with ekneuss on irc, and the big change would be,
that currently the typehints only checked in runtime, to enforce the
signature, the check should be done when the Subclass definition is
parsed by the engine (when it would have to autoload, the typehinted
class, etc. and it would require traversing the class hierarchy. which
would also create some performance penalty compared to the old
behavior)
the other thing, what ekneuss also pointed out, that in my example, I
mentioned allowing overriding the typehint from Superclass to
Subclass, but the opposite (allowing Super where Super was used in the
parent) would be more in line with the "allow to override as long as
it is more general than the parent" idea.

> * Allowing less arguments in subclasses, as I've argued in the thread.
I think that I mentioned that, maybe only after that mail, so yes, I'm
also support this, see my Square example in this thread.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to