Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17373 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78047 invoked by uid 1010); 22 Jul 2005 06:59:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78032 invoked from network); 22 Jul 2005 06:59:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2005 06:59:19 -0000 X-Host-Fingerprint: 84.148.144.44 p5494902C.dip0.t-ipconnect.de Received: from ([84.148.144.44:27427] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id C1/33-33635-64990E24 for ; Fri, 22 Jul 2005 02:59:19 -0400 Message-ID: To: internals@lists.php.net Date: Fri, 22 Jul 2005 08:59:20 +0200 User-Agent: Thunderbird 1.0+ (Windows/20050719) MIME-Version: 1.0 References: <42DFCA59.6090108@caedmon.net> <8F.8F.33635.D0100E24@pb1.pair.com> <42E002F4.3080605@caedmon.net> In-Reply-To: <42E002F4.3080605@caedmon.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 84.148.144.44 Subject: Re: [PHP-DEV] $this availability inside static-functions From: lists@sebastianmendel.de (Sebastian Mendel) Sean Coates wrote: >> i know this hack, but it does not work, if the statically called method >> is from the same class as the calling object > > Good point. Sorry for not noticing. > ... I have no idea WHY someone would want to do this.. that said, I > don't know of a way to do it, either. a function who returns a name of an object, say its name is $object->getName(); this needs that the object exists and loaded how about if i need a name for object not loaded? Class::getName( $object_id ); there is really no need to load/create the whole object if i only need the name, so doing $object = new Class( $object_id ); $object->getName(); would be a waste of system-resources f.e. the same applies to any other properties of an object stored in a DB. but why should i choose for the same function two different method-names? f.e. Class::getName() static Class::staticGetName() ?? this doesnt makes sence to me. pls, give me a hint if i had overseen something. -- Sebastian Mendel www.sebastianmendel.de www.sf.net/projects/phpdatetime | www.sf.net/projects/phptimesheet