Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9568 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14055 invoked by uid 1010); 26 Apr 2004 16:32:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13959 invoked from network); 26 Apr 2004 16:32:20 -0000 Received: from unknown (HELO art3mis.com) (217.172.66.234) by pb1.pair.com with SMTP; 26 Apr 2004 16:32:20 -0000 Received: (qmail 1377 invoked from network); 26 Apr 2004 16:31:51 -0000 Received: from unknown (HELO SPAWN) (80.38.117.84) by 10.1.0.18 with SMTP; 26 Apr 2004 16:31:51 -0000 To: Date: Mon, 26 Apr 2004 18:34:49 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0003_01C42BBD.28CE7990" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Thread-Index: AcQrrGSeL5SmCr/bQfGfwRhq+UZUqQ== X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on wolverine X-Spam-Status: No, hits=0.1 required=4.0 tests=HTML_70_80,HTML_MESSAGE autolearn=no version=2.63 X-Spam-Level: Subject: Workaround for inability to know calling class inside an inherited method? From: jalonso@art3mis.com ("Juan Alonso") Message-ID: ------=_NextPart_000_0003_01C42BBD.28CE7990 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit If a class inherits a method from a parent function and you call the parent method from the inherited class you cannot refer to variables referred in the inherited class. Is there a language construct to refer to the calling class inside a method? The example will explain it better: And it generates: Fatal error: Access to undeclared static property: db::$connString in /var/dev/jalonso.gea/app/db_new.php on line 6 I know this has been brought before but I don't remember if there is any workaround besides redefining the method in the inherited class and passing the parent class it's name, which is what I am doing currently: Regards, Juan Alonso ------=_NextPart_000_0003_01C42BBD.28CE7990--