Re: Allowing `(object)['key' => 'value']` in initializers?
| From: | Marco Pivetta | Date: | Sat, 25 Sep 2021 15:48:08 +0000 |
| Subject: | Re: Allowing `(object)['key' => 'value']` in initializers? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116159@lists.php.net to get a copy of this message | ||
Hey Tyson,
On Sat, 25 Sep 2021, 17:45 tyson andre, <tysonandre775@hotmail.com> wrote:
> What are your thoughts on allowing the
(object) cast in
> initializer
> types where new was already allowed, but only when followed by
> an array
> literal node. (e.g. continue to forbid (object)SOME_CONSTANT)
> (see
> https://wiki.php.net/rfc/new_in_initializers)
>
Right now, there's even an interest in getting rid (or deprecating) dynamic
properties on objects: why push the complete opposite ways?
What is the actual value of using an stdClass instance instead of an
array<string, mixed> (already supported)?
>