Hi!

class A {
     public function foo(Foo $a = null) {}
}

class B extends A {
     public function foo() {}
}

class C extends B {
     public function foo(Bar $a = null) {}
}

Here B::foo() is compatible with A:foo() and as the parameter is
optional C::foo() is compatible with B::foo(). But C::foo() is no more
compatible with A::foo().

Between B and C there's of course incompatibility - while B accepts anything (and ignores it), C accepts only Bar or nothing. But I was talking between A and B!

--
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

Reply via email to