Re: [RFC][Draft] Body-less __construct

From: Date: Tue, 11 May 2021 14:53:44 +0000
Subject: Re: [RFC][Draft] Body-less __construct
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-114395@lists.php.net to get a copy of this message
Le 11/05/2021 à 16:50, Chase Peeler a écrit :
On Tue, May 11, 2021 at 10:48 AM Matīss Treinis <mrtreinis@gmail.com> wrote:
Hi Sara,
While it's certainly silly/pointless to have a nil constructor when
there are non-promoted args present, I think that deliberately making that mode special (read: inconsistent) is the wrong way to go. Sorry, but I don't follow - so you would prefer that this:
     public function __construct();
be valid syntax as well, considering within the scope of the proposed? Am I reading this right?
Yes. It might be silly and pointless, but, it doesn't have any negative side effects, so why not?
I agree, even for all methods, if I can avoid the {} when I don't need it. To go further, for any method that return void or a nullable type, it would be a nice to have the semicolon syntax automatically returning null or void when possible, for when implementing an interface method or abstract method you actually don't need to implement. Regards, Pierre

Thread (34 messages)

« previous php.internals (#114395) next »