Re: [Proposal] Struct Data Types
| From: | Rowan Collins | Date: | Fri, 15 Mar 2019 15:23:08 +0000 |
| Subject: | Re: [Proposal] Struct Data Types | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104749@lists.php.net to get a copy of this message | ||
On Fri, 15 Mar 2019 at 15:16, Levi Morrison <levim@php.net> wrote:
> We could also add an object literal
> syntax for creating ad-hoc stdClass objects like so: `$obj = { x: 1,
> y: 1}`. This has an ambiguity, but I believe I have solved the issue
> without too much trouble once before.
>
Minor side-note, but I'd love to see things like this creating anonymous
classes, now we have them, rather than stdClass objects.
So $obj = { x: 1, y: 1 } would de-sugar to $obj = new class { public $x=1;
public $y=1; }
Regards,
--
Rowan Collins
[IMSoP]