Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14360 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34323 invoked by uid 1010); 12 Jan 2005 17:34:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34256 invoked from network); 12 Jan 2005 17:34:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2005 17:34:45 -0000 X-Host-Fingerprint: 166.84.1.74 mail3.panix.com NetBSD 1.6Z (DF) Received: from ([166.84.1.74:64386] helo=mail3.panix.com) by pb1.pair.com (ecelerity HEAD (r4059)) with SMTP id 85/65-09312-CAF55E14 for ; Wed, 12 Jan 2005 12:34:37 -0500 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mail3.panix.com (Postfix) with ESMTP id 8AB3298203 for ; Wed, 12 Jan 2005 12:34:25 -0500 (EST) Received: (from analysis@localhost) by panix5.panix.com (8.11.6p3/8.8.8/PanixN1.1) id j0CHYPX16239 for internals@lists.php.net; Wed, 12 Jan 2005 12:34:25 -0500 (EST) Date: Wed, 12 Jan 2005 12:34:25 -0500 To: PHP Internals List Message-ID: <20050112173425.GA1234@panix.com> References: <20050112155751.33379.qmail@pb1.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112155751.33379.qmail@pb1.pair.com> User-Agent: Mutt/1.4.2.1i Subject: Re: [PHP-DEV] Get name of extending class with static method call (PHP5) From: danielc@analysisandsolutions.com (Daniel Convissor) Torsten: On Wed, Jan 12, 2005 at 04:58:20PM +0100, Torsten Roehr wrote: > How can I get the name of the extending class that invoked the method in > drive()? class Car { function drive($child) { echo "parent driven in a $child\n"; } } class Porsche extends Car { function drive() { parent::drive(get_class()); } } Porsche::drive(); --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409