Re: [RFC] Constructor Property Promotion

From: Date: Thu, 26 Mar 2020 16:01:57 +0000
Subject: Re: [RFC] Constructor Property Promotion
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-109338@lists.php.net to get a copy of this message
Hello! With all respect, seems a bit confuses to me, without in fact offer a new feature, just a shortcut. I hope it's me seeing it the wrong way. What happen if I rename the constructor parameters on a child class constructor? Example (https://3v4l.org/VqQde): class A { public function __construct(public int $x) { ... } } class B extends A { public function __construct(public int $y) { ...; parent::__construct($y); } } Atenciosamente, David Rodrigues Em qui., 26 de mar. de 2020 às 12:45, Sebastian Bergmann <sebastian@php.net> escreveu: > Am 26.03.2020 um 14:30 schrieb Nikita Popov: > > I would like to submit the following RFC for your consideration: > > https://wiki.php.net/rfc/constructor_promotion > > Looks good to me! Thanks. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#109338) next »