Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79226 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98477 invoked from network); 27 Nov 2014 12:44:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2014 12:44:13 -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.172 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:43544] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/F0-27910-99C17745 for ; Thu, 27 Nov 2014 07:44:10 -0500 Received: by mail-wi0-f172.google.com with SMTP id n3so15607284wiv.17 for ; Thu, 27 Nov 2014 04:44:06 -0800 (PST) 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=+FrIrZGqw+XTJdB5ErSbMIPV9PEpvJHnbjcmATISrW0=; b=mueg36QRtoi0e8Hb4e+ACEoWwYv0zqrm2zIEewSQaLCBY31yASt2FKgfntlz4N2YVZ Pu2Jh/9NK5f6nlsywzwAjOG5NoRpIm4JEC6NbDgmJ4VCwCLRsGuHXqqOb5ygq0pqEScj DXd4ZKukm3lUmvzPNS4ztc4/35gaV6D5Xh/+X/IMMNoT4t7CrWWX1myOVyyDc++1nK2A xZU4x5YhjagJdfN4TdYH27XghGGBzY/AO+pxGkLpMVAUKbS+ABEk1pbsL3qi8iH6Mc0C VHvsGKEYwpAIDTlOSjyJJ3gdBpsjwmk2BMVaea7BpxgvRrOTk3imKUWOO1O1W/rOAInL o6tw== X-Received: by 10.180.218.39 with SMTP id pd7mr30349438wic.21.1417092246536; Thu, 27 Nov 2014 04:44:06 -0800 (PST) Received: from [192.168.0.148] ([62.189.198.114]) by mx.google.com with ESMTPSA id cz3sm10565168wjb.23.2014.11.27.04.44.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 04:44:05 -0800 (PST) Message-ID: <54771C61.5040507@gmail.com> Date: Thu, 27 Nov 2014 12:43:13 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Abstract final classes From: rowan.collins@gmail.com (Rowan Collins) Lazare Inepologlou wrote on 27/11/2014 10:35: > 2014-11-27 4:47 GMT+01:00 guilhermeblanco@gmail.com < > guilhermeblanco@gmail.com>: > >> Hi, >> >> I worked on an implementation of a somehow controversial concept that >> exists in hack and C#: abstract final classes. >> >> https://wiki.php.net/rfc/abstract_final_class >> >> My motivation is to further expand class support to add modifiers (PPP - >> public, protected, private). I added this change to initially segregate >> grammar rules. It was an easy feature without extensive complexity and >> covers some use-cases. >> >> > "Abstract final" is a strange way to name it. What you want is a "static" > class: > > * The fact that one cannot initialise an abstract class is only a side > effect. Abstract classes are meant to be used for inheritance. > > * Abstract static methods are not possible (one more reason why abstract is > a bad name). > > * A "static" class does not have to be final, given the fact that PHP is > one of the few languages that offer a robust Late Static Binding. This has always been my feeling. To me, "abstract" means "must be extended", and "final" means "can't be extended", so combining the two seems like a self-contradiction. The fact that abstract classes allow static methods to be called without sub-classing always seems a bit odd to me - it's as though only the constructor is really abstract, not the whole class. A "static" class, however, whether "final" or not, is definitely something I've wanted. Regards, -- Rowan Collins [IMSoP]