Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69722 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36822 invoked from network); 21 Oct 2013 08:29:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2013 08:29:22 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.47 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.214.47 mail-bk0-f47.google.com Received: from [209.85.214.47] ([209.85.214.47:61027] helo=mail-bk0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/AD-44908-1E5E4625 for ; Mon, 21 Oct 2013 04:29:21 -0400 Received: by mail-bk0-f47.google.com with SMTP id mx12so590496bkb.20 for ; Mon, 21 Oct 2013 01:29:18 -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=m7kExpRU0hiJixIOLTCzSPAJs/spKIj8k8/1GixKG7s=; b=sTf2Ea7G0oBAv9/w8uIy+l2wsiEFsXiMFYDo3djQprNOLT9x4yi8EMCAyWaUU4oIDJ YgIprUsZ/OoPfCg12kDSwKZW5zCm2C6v45TtCNLfOPsTwo22EMvbZrWgavvl7dLuzmyv EQ8XaiO0YbrkKmW0hrtcE+G3//ZcvCgI39gGWr1FiZgzCJZBWBKpl+GGuZi40TVmPjSl 2RJHWN7IY34iKw764PCr9xLAqLCUllvee1NPC3/SAsf3SvCQGQPyGi8dqwuMQWd1KqZ8 DovDO01rbC7AN1SX0NJMKc2n+m8iZU0vjFv/ldmER5KmBUC6lyf910GT4j2Bx+W5gO85 xcpA== X-Received: by 10.204.233.129 with SMTP id jy1mr505326bkb.27.1382344158465; Mon, 21 Oct 2013 01:29:18 -0700 (PDT) Received: from [192.168.0.145] ([62.189.198.114]) by mx.google.com with ESMTPSA id pn6sm8612272bkb.14.2013.10.21.01.29.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Oct 2013 01:29:17 -0700 (PDT) Message-ID: <5264E5DD.4060203@gmail.com> Date: Mon, 21 Oct 2013 09:29:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: internals@lists.php.net References: <3D.BC.23638.84CA1625@pb1.pair.com> <000301cecd1b$9aa133f0$cfe39bd0$@tutteli.ch> <526488C1.8020400@php.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Declaring purely static classes [Was Re: [PHP-DEV] RFC: Expectations] From: rowan.collins@gmail.com (Rowan Collins) Matthew Leverton wrote (on 21/10/2013): > final/abstract (although PHP doesn't allow that combo for some reason) Final means "cannot be sub-classed", abstract means "must be sub-classed"; the combination would make no sense. Specifically, it would allow completely illogical code like "final abstract class Foo { abstract public function some_method(); }" Incidentally, Java doesn't allow this combination either; this isn't PHP being picky. The logical declaration for a class that can only be used statically would be "static class Foo { ... }". The combination "abstract static" also makes sense (for a static class with missing method bodies). There's an ancient RFC proposing that here, but it seems it didn't get anywhere much: https://wiki.php.net/rfc/static-classes Regards, -- Rowan Collins [IMSoP]