Hi!
On 9/20/11 12:07 PM, Reindl Harald wrote:
but it is not logical
foo() in B can do anything with $a before or after parent::foo()
and the caller does not need to know at any point that B
has anything to do with the class A
Consider this code:
function doFoo(A $a) {
$a->foo();
}
It's fine, right? Since A::foo() signature fits.
Now consider this code:
$a = new B(); // B extends A, it's OK, right?
doFoo($a); // oops, $a->foo() breaks!
This code would break since B::foo() requires a parameter.
--
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