Re: [RFC][DISCUSSION] - Immutable classes and properties
| From: | Silvio Marijić | Date: | Tue, 17 Jan 2017 09:33:09 +0000 |
| Subject: | Re: [RFC][DISCUSSION] - Immutable classes and properties | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97803@lists.php.net to get a copy of this message | ||
Hi Yasuo,
Yes, that looks like interesting idea. I can open another RFC and start
working on that one, if there is a interest for that. Why can't we fit that
into 7.2 ?
Cheers,
2017-01-17 10:12 GMT+01:00 Yasuo Ohgaki <yohgaki@ohgaki.net>:
> Hi Silvio,
>
> On Tue, Dec 13, 2016 at 6:17 PM, Silvio Marijić <marijic.silvio@gmail.com>
> wrote:
>
>> After much thinking regarding array in immutable objects I'm thinking of
>> revoking this RFC. If someone has some suggestion on that matter now is
>> the
>> time, but otherwise my work is done on this one.
>>
>
> It may be good to start from constant scalars.
> ES6 has "let" and "const". PHP has "const", but PHP's
> constant does not
> have scope other than class. It would be nice if const can be used like JS.
>
> e.g. Following is syntax error.
> <?php
> function foo($v) {
> const v=$v;
> // Some complex code here.
> return v * $var;
> }
>
> var_dump(foo(123));
> ?>
>
> It would be large enough changes for 8.0, though.
>
> Regards,
>
> --
> Yasuo Ohgaki
> yohgaki@ohgaki.net
>
--
Silvio Marijić
Software Engineer
2e Systems