Re: Optional constructor body
| From: | Christoph M. Becker | Date: | Thu, 18 Jul 2024 09:38:59 +0000 |
| Subject: | Re: Optional constructor body | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124467@lists.php.net to get a copy of this message | ||
Hi Oliver!
On 18.07.2024 at 11:21, Oliver Nybroe wrote:
> I am looking into making the constructor body optional in classes,
> essentially allowing you to write
>
> ```
> class User {
> public function __construct(
> private string $name,
> )
> }
> ```
See https://externals.io/message/114324 for a
prior discussion of a very
similar idea.
Cheers,
Christoph