Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84605 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68798 invoked from network); 12 Mar 2015 00:10:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2015 00:10:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.174 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.174 mail-wi0-f174.google.com Received: from [209.85.212.174] ([209.85.212.174:38599] helo=mail-wi0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/E0-64353-C69D0055 for ; Wed, 11 Mar 2015 19:10:20 -0500 Received: by widex7 with SMTP id ex7so42672488wid.3 for ; Wed, 11 Mar 2015 17:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=2X/2cbc9lOQozL7oPTQwNY89w7RN9BW4Jf39BkcSBnA=; b=K23FYdtb9+Q3a6phMyiUqLjNFpplarBPCZ08C4sqlhEIvXkUUIPmLxYb0AfJluTiwX UTHriMb4YhVEFEKLRENcZDRu+YRzoxD3zyWpKvPZAAVrzFLTYM+fcWCYNJ3Cg4eZMswi i1nh3XlVvQe9V+P2CnIFWGpdmb5d2PDONGq4+ijUS0qi1lKJ5Yi4dr7C6wFrsN31pdib xHZExiL+Gp1a0m8IgICFfkY2j4YpakMs2r+GceCn+6FR3RtsG+mh36XQkor1iPJPJUD8 /oSYnRCQ+iacqlp2oZ8bfAkXvsufGAgF5c01jNN1xOT5ymXy+RU7qf0mGzv3vI3fX5rc Rs/A== X-Received: by 10.180.80.199 with SMTP id t7mr8774025wix.52.1426119017046; Wed, 11 Mar 2015 17:10:17 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id vq9sm7598684wjc.6.2015.03.11.17.10.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 17:10:16 -0700 (PDT) Message-ID: <5500D967.5040800@gmail.com> Date: Thu, 12 Mar 2015 00:10:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: internals@lists.php.net References: <6D.2C.32765.10EC0055@pb1.pair.com> In-Reply-To: <6D.2C.32765.10EC0055@pb1.pair.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] static constructor From: rowan.collins@gmail.com (Rowan Collins) On 11/03/2015 23:21, Johannes Ott wrote: > So now I want to do my first own proposal for a new function in PHP and > I hope doing it right with starting a discussion here first. > > The purpose of this suggestion is to introduce a static constructor, > which is called before the first call to class either static or > non-static to initialize some static properties which are needed by the > class. Can you give an example use case for when this would be useful? I'm struggling to think of one for which there isn't already an established coding pattern... Regards, -- Rowan Collins [IMSoP]