Re: [RFC][DISCUSSION] - Immutable classes and properties
| From: | Yasuo Ohgaki | Date: | Tue, 17 Jan 2017 09:12:30 +0000 |
| Subject: | Re: [RFC][DISCUSSION] - Immutable classes and properties | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97801@lists.php.net to get a copy of this message | ||
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