Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-04-08 Thread Nikita Popov
On Wed, Apr 8, 2020 at 1:56 PM Nicolas Grekas wrote: > > I would like to submit the following RFC for your consideration: >> https://wiki.php.net/rfc/constructor_promotion >> > > I love it :) > > Just one question: > Shouldn't default values be copied on the signature? That would be > expected

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-04-08 Thread Nicolas Grekas
> I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > I love it :) Just one question: Shouldn't default values be copied on the signature? That would be expected for me. (and that would make the properties still initialized when

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-04-02 Thread Nikita Popov
On Thu, Apr 2, 2020 at 3:47 PM Markus Fischer wrote: > Him > > On 02.04.20 12:07, Nikita Popov wrote: > > Reflection will see the state after desugaring. That is, it just sees > > normal properties and normal constructor args. I've made this more > explicit > > in the RFC now: >

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-04-02 Thread Markus Fischer
Him On 02.04.20 12:07, Nikita Popov wrote: Reflection will see the state after desugaring. That is, it just sees normal properties and normal constructor args. I've made this more explicit in the RFC now: https://wiki.php.net/rfc/constructor_promotion#reflection Thanks! Another one, also

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-04-02 Thread Nikita Popov
On Thu, Apr 2, 2020 at 1:35 AM Markus Fischer wrote: > Hi, > On 2020-03-26 14:30, Nikita Popov wrote: > > I would like to submit the following RFC for your consideration: > > https://wiki.php.net/rfc/constructor_promotion > > > > This is based on one off the suggestions made in > >

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-04-01 Thread Markus Fischer
Hi, On 2020-03-26 14:30, Nikita Popov wrote: I would like to submit the following RFC for your consideration: https://wiki.php.net/rfc/constructor_promotion This is based on one off the suggestions made in https://externals.io/message/109220, and some existing discussion on the topic can be

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Stanislav Malyshev
Hi! > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion I like this shortcut. I am not sure though I understand why callable is not allowed? Can't it just create a non-typed property? -- Stas Malyshev smalys...@gmail.com -- PHP

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Nikita Popov
On Thu, Mar 26, 2020 at 5:02 PM David Rodrigues wrote: > 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?

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Ben Ramsey
> On Mar 26, 2020, at 08:30, Nikita Popov wrote: > > Hi internals, > > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > > This is based on one off the suggestions made in > https://externals.io/message/109220, and some existing

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Michał Brzuchalski
czw., 26 mar 2020 o 14:31 Nikita Popov napisał(a): > Hi internals, > > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > > This is based on one off the suggestions made in > https://externals.io/message/109220, and some existing

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Sara Golemon
On Thu, Mar 26, 2020 at 8:31 AM Nikita Popov wrote: > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > > This is based on one off the suggestions made in > https://externals.io/message/109220, and some existing discussion on the

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Chase Peeler
On Thu, Mar 26, 2020 at 9:33 AM Paul M. Jones wrote: > > > > On Mar 26, 2020, at 08:30, Nikita Popov wrote: > > > > Hi internals, > > > > I would like to submit the following RFC for your consideration: > > https://wiki.php.net/rfc/constructor_promotion > > Big fan. Thanks for this. > > I like

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread David Rodrigues
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

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Sebastian Bergmann
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

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Paul M. Jones
> On Mar 26, 2020, at 08:30, Nikita Popov wrote: > > Hi internals, > > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion Big fan. Thanks for this. -- Paul M. Jones pmjo...@pmjones.io http://paul-m-jones.com Modernizing

[PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Nikita Popov
Hi internals, I would like to submit the following RFC for your consideration: https://wiki.php.net/rfc/constructor_promotion This is based on one off the suggestions made in https://externals.io/message/109220, and some existing discussion on the topic can be found in that thread. The primary