Re: [RFC] New in initializers
| From: | Ben Ramsey | Date: | Wed, 03 Mar 2021 15:52:12 +0000 |
| Subject: | Re: [RFC] New in initializers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-113352@lists.php.net to get a copy of this message | ||
> On Mar 3, 2021, at 09:03, Nikita Popov <nikita.ppv@gmail.com> wrote:
>
> Hi internals,
>
> I would like to propose allowing the use of "new" inside various
> initializer expressions: https://wiki.php.net/rfc/new_in_initializersÿëB
> ”¼LÇ�–`
>
> In particular, this allows specifying object default values for properties
> and parameters, and allows the use of objects as attribute arguments.
>
> The RFC is narrow in scope in that it only adds support for "new". An
> extension to other call kinds should be straightforward though.
I like this proposal!
Are nested new expressions allowed?
function test($foo = new A(new B(new C))) {}
Cheers,
Ben
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc