Re: Re: [RFC] Constructor Property Promotion

From: Date: Mon, 11 May 2020 15:26:27 +0000
Subject: Re: Re: [RFC] Constructor Property Promotion
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-110132@lists.php.net to get a copy of this message
On Mon, 11 May 2020 at 10:52, Nikita Popov <nikita.ppv@gmail.com> wrote: > > Please tell me if you have further concerns Question - as this is just sugar, presumably it doesn't add much complexity to the PHP engine? Vague concern - because it's a novel syntax, I find it hard to read, particularly when there are comments* for the properties. Do you think I'll just get used to it, or is it likely to be an ongoing issue? Also, in five years time, if we have structs**, people will be wondering why we bothered with this. But I think it does make life easier for developers in the meantime. cheers Dan Ack * Example of comments. class UrlToPdfProcessor { public function __construct( // The full url to reach the instance of chrome running in headless mode. public string $chromeUrl, // A path to a directory where the output PDF will be written to. // It must already exist and be writeable by the process running // the PDF processor. public string $tmpPath, // The internal domain name for the site to be rendered. // The domain name should not contain either protocol or path // components string $internalDomain ) { } } ** structs - https://github.com/Danack/RfcCodex/blob/master/structs.md

« previous php.internals (#110132) next »