Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12279 invoked from network); 16 Feb 2015 07:36:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 07:36:46 -0000 Authentication-Results: pb1.pair.com header.from=bof@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bof@bof.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: bof@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:35520] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/35-05176-D0E91E45 for ; Mon, 16 Feb 2015 02:36:45 -0500 Received: (qmail 31325 invoked by uid 1009); 16 Feb 2015 08:36:42 +0100 Received: from 209.85.216.170 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/20064. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.216.170):. Processed in 0.271375 secs); 16 Feb 2015 07:36:42 -0000 X-Antivirus-MYDOMAIN-Mail-From: bof@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.216.170):. Processed in 0.271375 secs Process 31319) Received: from mail-qc0-f170.google.com (gmail@bof.de@209.85.216.170) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 16 Feb 2015 08:36:42 +0100 Received: by mail-qc0-f170.google.com with SMTP id c9so11333742qcz.1 for ; Sun, 15 Feb 2015 23:36:40 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.229.192.5 with SMTP id do5mr430614qcb.12.1424072200744; Sun, 15 Feb 2015 23:36:40 -0800 (PST) Received: by 10.140.104.65 with HTTP; Sun, 15 Feb 2015 23:36:40 -0800 (PST) Received: by 10.140.104.65 with HTTP; Sun, 15 Feb 2015 23:36:40 -0800 (PST) In-Reply-To: <54E1260F.2070101@gmail.com> References: <54E1260F.2070101@gmail.com> Date: Mon, 16 Feb 2015 08:36:40 +0100 Message-ID: To: Rowan Collins Cc: internals Content-Type: multipart/alternative; boundary=001a11337bfca8f699050f2fa560 Subject: Re: [PHP-DEV] A modest proposal: __contructStatic From: bof@bof.de (Patrick Schaaf) --001a11337bfca8f699050f2fa560 Content-Type: text/plain; charset=UTF-8 Am 16.02.2015 00:05 schrieb "Rowan Collins" : > > A quick thought - if you want to stick with the "magic static call" pattern, you can implement this much more simply by doing something similar to Laravel's "facades" [1]: >... > This basically implements in userspace what you propose to add to the language, with the only caveat being that you must separate the concerns of adding extra functionality, and wrapping it in a static facade, into two separate classes. That was one of my intermediate steps before reaching the current approach, but it irked me that when switching code from MyRedis static/singleton usage to real instance usage I suddenly have to write a different class. In my scheme, where I can use red_global::get() I can as well use $redis = new red_global(); $redis->get(); without thinking about how that companion class was named. Sure, no big issue. But a small one... By itself, surely not enough reason for a language change :) It's all a question of how many other small such uses there would be. best regards Patrick --001a11337bfca8f699050f2fa560--