Re: [RFC] Readonly Properties
| From: | Andrea Faulds | Date: | Mon, 27 Oct 2014 19:25:05 +0000 |
| Subject: | Re: [RFC] Readonly Properties | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78401@lists.php.net to get a copy of this message | ||
> On 27 Oct 2014, at 18:31, Dmitry Stogov <dmitry@zend.com> wrote:
>
> Hi Andrea,
>
> I don't have strong opinion about this proposal.
> It doesn't make any harm to the engine, and it really may speed-up code especially written
> for read-only properties.
> On the other hand you introduce new orthogonal to private/protected/public visibility rule,
> and I'm not sure if this complication is good for language.
>
> Why did you disable read-only static methods? (I just didn't get it).
You couldn't really have a read-only method, there's no get/set equivalent for methods.
The reason they're explicitly disallowed in the code is because, to avoid shift/reduce
conflicts, I have to add it as a member modifier but then check the AST to see if it was used.
The reason for disallowing static methods is we currently don't use separate code paths for
get/set of static methods, we just call one function to obtain a pointer. Of course I could make
that function be told whether it's for writing, I just hadn't done it yet.
--
Andrea Faulds
http://ajf.me/