Re: [RFC] Static classes (Was Abstract final classes)
| From: | Stanislav Malyshev | Date: | Mon, 01 Dec 2014 23:22:03 +0000 |
| Subject: | Re: [RFC] Static classes (Was Abstract final classes) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79364@lists.php.net to get a copy of this message | ||
Hi!
> To get a bit philosophical: Is it really the language's job to make
> that decision? Is there a difference between "encouraging",
> "allowing", and "enabling"?
I think, yes on both. The PHP tradition is to allow doing stuff that may
look weird (most languages won't allow you to do $$foo) but still there
are practices that we encourage, especially in OO space, and some even
that we enforce quite strictly (such as inheritance rules for methods).
> Purely static classes are a reality whether this feature is added or
> not. They do things namespaces can't (and probably shouldn't), but
Of course, you can create class containing of only static members. The
question is whether we need a language construct for ensuring that
certain class has only static members. I'm not sure this requires a
language-level construct.
--
Stas Malyshev
smalyshev@gmail.com