Re: static constructor
| From: | Rowan Collins | Date: | Fri, 13 Mar 2015 17:28:06 +0000 |
| Subject: | Re: static constructor | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84698@lists.php.net to get a copy of this message | ||
Johannes Ott wrote on 13/03/2015 15:35:
I think as Christoph wrote we should now do a cut here for the inital discussion, because we are in a circle now. I will now get on at the RFC process, and will prepare the RFC-draft asap. I will try to summarize as good as possible all discussion points we had the last days here. And I will try to figure out as clearly as possible how each point really touchs the purpose of the new requested language feature or is a general problem if you use static context a "wrong" way, although outside the static constructor. I want to say thank you especially to you Rowan, for the so far very good discussion, which gives a lot of input to me for writting the RFC.Yes, you are probably right. Thank you for putting up with my relative ignorance of the concepts, and I'm glad you found the discussion constructive. I do now see that there are some where this would be useful, particularly in lieu of enum or metaclass logic for pre-processing the pure data in a class definition. Where I vary is in the validity of some of the use cases presented, which feel like they're making static methods do things that belong in an object, but that's largely a matter of opinion and coding style rather than functionality. I think the most similar thing we have at the moment is destructors - you can't know exactly when they will be called, only that they will be, so have to be very careful not to put too much logic into them which can have odd side effects, generate errors at unexpected moments, etc. Regards, -- Rowan Collins [IMSoP]