On Tue, Sep 20, 2011 at 9:35 PM, Stas Malyshev <smalys...@sugarcrm.com> wrote: > 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 > >
A little bit off-topic, but maybe we could also discuss/fix this: https://bugs.php.net/bug.php?id=43200 http://groups.google.com/group/symfony-devs/browse_thread/thread/3fc16ba601045551 -- Ferenc Kovács @Tyr43l - http://tyrael.hu -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php