Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59328 invoked by uid 1010); 9 May 2005 18:20:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47078 invoked from network); 9 May 2005 18:06:00 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 9 May 2005 18:06:00 -0000 X-Host-Fingerprint: 66.80.117.3 longsword.omniti.com Linux 2.5 (sometimes 2.4) (4) Received: from ([66.80.117.3:47028] helo=mail.omniti.com) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 33/55-35155-786AF724 for ; Mon, 09 May 2005 14:05:59 -0400 DomainKey-Status: good X-DomainKeys: Ecelerity dk_sign implementing draft-delany-domainkeys-base-01 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=test; d=omniti.com; h=Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=TwS3OPSgS7zgcB3i7fOKipRKvtZhtk/hXDQPQvedcRrZ5zBoQgdoosCdx4kcky/h wiTFYh3VsAzQNYbwtw23fatHGeUJnzhOCcDiVFK47goc9BSU/+XTfvbyAjtisZJp Received: from ([66.80.117.2:52667] helo=[10.80.116.150]) by mail.omniti.com (ecelerity HEAD r(4355M)) with SMTP id BB/99-25344-F86AF724 for ; Mon, 09 May 2005 14:06:11 -0400 Message-ID: <427FA67E.2020506@omniti.com> Date: Mon, 09 May 2005 14:05:50 -0400 User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derrell.Lipman@UnwiredUniverse.com CC: internals References: <4qdcz84j.fsf@random.internal> In-Reply-To: <4qdcz84j.fsf@random.internal> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: new overloading feature? From: george@omniti.com (George Schlossnagle) Derrell.Lipman@UnwiredUniverse.com wrote: >Derrell.Lipman@UnwiredUniverse.com writes: > >Leonardo Pedretti writes: > > > >>I would like (for code cleanliness purposes) to make 'new' return a >>reference to an already created object under certain circumstances without >>using a factory, is it possible? >> >> > >A number of months ago, I proposed a similar feature, implemented as >overloading a __new() function. At the time, it seemed I was the only one who >wanted it, but your request is for a feature identical to my request. Here's >my previous message. (The whole thread can be found under the subject "new >overloading feature?" from 5 Nov 2004). I'd love for this to be revisited now >that there's someone else with a similar desire. > > I'm not an OO expert, but doesn't this break a fundamental semantic of OOP -- namely that new() returns a new object of the specified class. Isn't this the whole reason that the Singleton pattern exists? George