Le Tue, 11 May 2021 10:58:57 +0200,
Nikita Popov <[email protected]> a écrit :
> If we allow it, I would restrict it to specifically the case of a) a
> promoted constructor b) which has *only* promoted parameters. I don't think
> we should allow replacing "{}" with ";" for methods in the general case.
This would create a subtle difference of allowed syntax between a constructor
and an other method, and between a constructor with promoted parameters and
without. I think we should avoid this.
I even thought we merged changes to make constructors more like the other
methods, but I just checked and it seems the RFCs to allow ": void" on
constructors were declined.
Côme
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php