Re: static constructor
| From: | Alexey Zakhlestin | Date: | Thu, 12 Mar 2015 17:19:22 +0000 |
| Subject: | Re: static constructor | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84646@lists.php.net to get a copy of this message | ||
> On 12 Mar 2015, at 19:28, Larry Garfield <larry@garfieldtech.com> wrote:
>
> I thought it sounded familiar. Also check the list archive for "A modest proposal:
> __constructStatic" from a month ago. It was rejected then, too.
>
> Really, I cannot think of any cases where I want to have a static class self-initialize with
> global data (because all statics are just globals with a fancy dress) where I wouldn't slap
> myself for being stupid and not just making a proper object, factory, DI, or any number of other
> options are are 10x more testable and reusable and verifiable. Sure there's places you could
> use it; there's just much better options already available in the language and have been for a
> decade.
I guess it’s just “dreaming” about classes, which are first-class citizens, like in
smalltalk/ruby/python :-)
But this is just an approximation, anyway.
Real class-objects probably would never happen in PHP.
--
Alexey Zakhlestin
https://github.com/indeyets
PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc