Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7950 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92354 invoked by uid 1010); 18 Feb 2004 14:00:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92330 invoked from network); 18 Feb 2004 14:00:59 -0000 Received: from unknown (HELO smtprelay02.ispgateway.de) (62.67.200.157) by pb1.pair.com with SMTP; 18 Feb 2004 14:00:59 -0000 Received: (qmail 24370 invoked from network); 18 Feb 2004 14:00:58 -0000 Received: from unknown (HELO heinz-ruediger) (126482@[212.202.104.234]) (envelope-sender ) by smtprelay02.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 18 Feb 2004 14:00:58 -0000 To: Brad Fisher , internals@lists.php.net Date: Wed, 18 Feb 2004 15:01:59 +0100 MIME-Version: 1.0 Message-ID: <40337E67.4872.12BD0D@localhost> Priority: normal In-reply-to: <40327310.74714A7C@info-link.net> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Subject: Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5 From: fb@fbeyer.com ("Ferdinand Beyer") References: <40327310.74714A7C@info-link.net> On 17 Feb 2004 at 14:01, Brad Fisher wrote: > class D { > function bar() { > $c = new C; > // I'd like to call the A::foo method of C here... > // In PHP4, I could do something like: Why should one want to do that? Why should PHP allow this? $c is not an A, it is a C. Of course C is a special version of A, so it is compatible to A. But it still is a C. There will be a reason why C has overridden the A implementation of foo(). It is possible that the original implementation is not compatible to C, so it could be a risk to call the old method. The feature you are asking for is not available in any OO language and it even conflicts with the OOP ideology! -- Ferdinand Beyer