Hi!
On 9/19/11 2:32 AM, Gustavo Lopes wrote:
The thing if you introduce func_get_args() to the argument, any discussion
about enforcing signatures becomes meaningless. One could argue this
should be allowed:
class A {
function foo() {}
}
class B extends A {
function foo($a) {}
}
No, this can not be allowed because A's signature accepts any call,
including foo(), but B's only accepts one with at least one parameters,
so LSP is broken here. That is regardless of what A::foo() is doing
inside, since arguments are going to be checked first.
Having said that, even in this case I would probably not go as far as
producing a fatal error - though E_STRICT would be OK here.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php