Re: [PHP-DEV] Re: [RFC] New in initializers

2021-03-06 Thread Rowan Tommins
On 06/03/2021 12:09, Andrea Faulds wrote: This seems reasonable, but I fear it would create a similar mess to C++ with static initialisers, because a class constructor can do basically anything… That was my initial reaction, too, but it's actually pretty trivial to do static initialisation

[PHP-DEV] Re: [RFC] New in initializers

2021-03-06 Thread Andrea Faulds
Hi Nikita, Nikita Popov 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 In particular, this allows specifying object default values for properties and parameters, and allows the use of o