Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82765 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46129 invoked from network); 15 Feb 2015 23:09:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2015 23:09:44 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.18 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:59168] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/05-13857-63721E45 for ; Sun, 15 Feb 2015 18:09:44 -0500 Received: from [192.168.0.101] ([91.67.244.80]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Lug8u-1XNi3n0wzo-00zlRT; Mon, 16 Feb 2015 00:09:39 +0100 Message-ID: <54E12735.9090103@gmx.de> Date: Mon, 16 Feb 2015 00:09:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Patrick Schaaf , Rowan Collins CC: internals References: <54E0FBE0.10301@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:XMIbWbVrhPDMSri0WHUKoPmV9kR4Wz0RMxrWQrFl48DXDETEKr7 UYkQS03PL2A/M/y/eRGytWxoSQa56Eg+le4W+2LEGEwFBvedH579bXImzA5y5f10ub95N47 MAeMu72mpEgjoNFzpBvr1XYpeTTTc+XC0CcwODSPu7lMS2OWHuUqZa6dqAQ3Zi0lazBoXLb ecdfKL+Y82eDls/7YgoKw== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [PHP-DEV] A modest proposal: __contructStatic From: cmbecker69@gmx.de (Christoph Becker) Patrick Schaaf wrote: > Am 15.02.2015 21:05 schrieb "Rowan Collins" : > >> // Now wherever in the code you want the default instance, just use this: >> $value = MyRedis::singleton()->get($key); > > You can surely see how this is more readable / easier to write: > > $value = MyRedir::get($key); It's possible to add static methods or use __callStatic() to delegate to the singleton's instance methods, though. -- Christoph M. Becker