Richard Lynch wrote:
So what exactly is the purpose of enforcing the same args here?
Does it make the C code under the hood simpler?
Does it make PHP an order of magnitude faster?
I'm honestly just sitting here asking myself WHY anybody wants this,
and not finding any benefit at all.
I think this was stated before in this thread. The academic idea of OOP
is that children are essentially expanded variants of their parents, but
for all intends and purposes their interface is just like the parent
with some additions.
So in other words a child is an instance of all of its parent. If you
remove arguments from the signature of methods this no longer applies
and you have violated this OOP rule.
It should be possible to implement your inheritance in such a way that
this will not bite you, but I do not think its PHP job to police this by
default. I want to bring up again the idea of an optional strict mode
(alternatively we can talk about a lax mode, but I think it makes more
sense to maintain BC and stay lax by default) that does it all according
to academic OOP (check signature of children, disallow on the fly static
properties etc.).
regards,
Lukas
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php