Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85795 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98726 invoked from network); 14 Apr 2015 00:39:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2015 00:39:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.172 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.213.172 mail-ig0-f172.google.com Received: from [209.85.213.172] ([209.85.213.172:38281] helo=mail-ig0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/00-32769-DB16C255 for ; Mon, 13 Apr 2015 20:39:25 -0400 Received: by igbqf9 with SMTP id qf9so2972068igb.1 for ; Mon, 13 Apr 2015 17:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=P3aPv+UtatZ9GaehWzarCPUMOoUTi3aYSq8o/ZKh6hQ=; b=DFXrYGmcphqKHENkESnrQO605lN8R29e559Y+aczOfIibTZTd25LEP9ONZkkZ46MfS IS/cITvZhL68rUCev3IuU8nOEuRCuQCaoB2cDDavOyjm6qA9FfDsKXEiyeW0/gA2KMC9 Z/l1qSPqPB3TQptFl4umjNjk0jcpJ/dyK/OOYO+LNirjG1mFtbOvNvZwUsR7qj9a7/2i lOZ5cE40dnugcFkQ4OQMkdM3nDffMX7a7L3vriBzs7t5ndx1PjFIIxGAfGhsUCFAWJHI 5nmkyLQFAnhGeU4AOgFilvjqKGyX49zFRtR9b/cZMalKNLUv7vWCyv+9ln9qBKskz/zY h3IQ== X-Received: by 10.43.24.76 with SMTP id rd12mr22305734icb.84.1428971962761; Mon, 13 Apr 2015 17:39:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.93.144 with HTTP; Mon, 13 Apr 2015 17:39:02 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Apr 2015 21:39:02 -0300 Message-ID: To: Johannes Ott Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] New RFC draft "static class constructor" From: marcio.web2@gmail.com (Marcio Almada) Hi, 2015-04-13 10:37 GMT-03:00 Johannes Ott : > Hi, > > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. > > As I already mentioned in the prediscussion thread here: > > For being my first change to the PHP core, I would be very happy, if > someone of the "old stager" would help me with the implementation of > this RFC if it is accepted. > > Regards > > -- > DerOetzi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > I know this is still a draft, but conceptually I don't like this feature. I always avoid static state on classes as much as possible and I think this should be avoided. But this is my personal opinion. Some suggestions: In case the RFC passes, I'd prefer to have a `static{ ... }` block instead of yet another static __ method. The reason is that this kind of construct is already known on other languages as `static{...}` and that feels more organized IMMO. In case you decide to proceed with the magic method approach, I'd prefer the more verbose `__staticConstruct` name because it seems clearer. Thanks, M=C3=A1rcio