Nikita,

I agree with your views, although, I think your last suggestion comes
close to being close to some sort of weird method overloading (the way
I understood it).

I'd expect B::foo() to throw a warning/error and maybe stop there, and
you're considering reaching to the parent method to see if that
signature matches the function call...

While method overloading would be interesting to have (see previous
discussions on the matter ;)) this is a sort of weird and unexpected
reaching-back behaviour... I'm not sure this seems like a logical
approach, I say stick with the error and expect a consistent usage of
the (rewritten) API and prevent obscure bugs where you change an
implementation and rewrite param names when in fact you should stay
consistent with the existing code if you're extending existing
behaviour!

In fact I'm not sure if the other way around should be the norm; where
we'd force the dev to implement the *same* args as the parent (like it
is now: i.e. type hinting, same signature, etc); even if it's just to
do an unset($oldbar) inside something like B::foo($newBar, $oldBar =
NULL)

Was that clear?

Thanks,
Daniel Macedo

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

Reply via email to