Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16186 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87860 invoked by uid 1010); 9 May 2005 20:45:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74908 invoked from network); 9 May 2005 20:36:38 -0000 Received: from unknown (HELO php.net) (127.0.0.1) by localhost with SMTP; 9 May 2005 20:36:38 -0000 X-Host-Fingerprint: 212.112.227.169 ipx11223.ipxserver.de Linux 2.4/2.6 Received: from ([212.112.227.169:58081] helo=ipx11223.ipxserver.de) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 6D/2A-35155-6D9CF724 for ; Mon, 09 May 2005 16:36:38 -0400 Received: from localhost (localhost [127.0.0.1]) by ipx11223.ipxserver.de (Postfix) with ESMTP id 5B325DF0175; Mon, 9 May 2005 22:37:03 +0200 (CEST) Received: from ipx11223.ipxserver.de ([127.0.0.1]) by localhost (ipx11223 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31913-07; Mon, 9 May 2005 22:36:59 +0200 (CEST) Received: from [192.168.0.101] (user-0cal1oq.cable.mindspring.com [24.170.135.26]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ipx11223.ipxserver.de (Postfix) with ESMTP id 991E1DF0161; Mon, 9 May 2005 22:36:58 +0200 (CEST) Message-ID: <427FC9D1.1030607@php.net> Date: Mon, 09 May 2005 16:36:33 -0400 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: George Schlossnagle Cc: Derrell.Lipman@UnwiredUniverse.com, internals References: <4qdcz84j.fsf@random.internal> <427FA67E.2020506@omniti.com> In-Reply-To: <427FA67E.2020506@omniti.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by somedaemon at backendmedia.com Subject: Re: [PHP-DEV] Re: new overloading feature? From: lsmith@php.net (Lukas Smith) George Schlossnagle wrote: > 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? yeah I would agree that we should always try to find a non magic solution and in this case a singleton seems to be the obvious choice. however currently its kinda hard to write a singleton that will work even if you inherit from the base class that implements the singleton due to: http://bugs.php.net/bug.php?id=30235 regards, Lukas