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 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.

Regards,
Nikita


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…

I'm not sure what can be done about it, though.

Thanks,
Andrea

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to