Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Lars Strojny
Hi Sean, thanks for your answers. Am 08.08.2013 um 02:54 schrieb Sean Cannella se...@fb.com: It does in the sense the same way as the current mode enforces types on properties. That is, there's no guarantee that types will remain as initially set, only that the values passed to the

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Leigh
On 7 August 2013 20:47, Sean Cannella se...@fb.com wrote: https://wiki.php.net/rfc/constructor-promotion What do you all think? I'm not sure what problem this is really trying to solve, the boilerplate code you mention is very explicit and it is very clear to the reader what is being done.

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Jordi Boggiano
On 08.08.2013 10:34, Leigh wrote: I'm not sure what problem this is really trying to solve, the boilerplate code you mention is very explicit and it is very clear to the reader what is being done. Each property documented with its type, purpose and visibility in a common place for easy

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Martin Keckeis
Am 08.08.2013 12:34 schrieb Jordi Boggiano j.boggi...@seld.be: On 08.08.2013 10:34, Leigh wrote: I'm not sure what problem this is really trying to solve, the boilerplate code you mention is very explicit and it is very clear to the reader what is being done. Each property documented with

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Matthieu Napoli
Le 08/08/2013 13:11, Martin Keckeis a écrit : Am 08.08.2013 12:34 schrieb Jordi Boggiano j.boggi...@seld.be: On 08.08.2013 10:34, Leigh wrote: I'm not sure what problem this is really trying to solve, the boilerplate code you mention is very explicit and it is very clear to the reader what

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Leigh
On 8 August 2013 14:12, Matthieu Napoli matth...@mnapoli.fr wrote: class MyClass { public $foo; protected $bar; public function __construct($this-foo, $this-bar, $baz) { // $this-foo and $this-bar are now set This actually feels _way_ more intuitive to me, it feels like you are

AW: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Robert Stoll
as before. -Ursprüngliche Nachricht- Von: Leigh [mailto:lei...@gmail.com] Gesendet: Donnerstag, 8. August 2013 17:17 An: Matthieu Napoli Cc: internals@lists.php.net Betreff: Re: [PHP-DEV] RFC: constructor argument promotion On 8 August 2013 14:12, Matthieu Napoli matth...@mnapoli.fr wrote

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Michael Wallner
On 8 August 2013 17:16, Leigh lei...@gmail.com wrote: On 8 August 2013 14:12, Matthieu Napoli matth...@mnapoli.fr wrote: class MyClass { public $foo; protected $bar; public function __construct($this-foo, $this-bar, $baz) { // $this-foo and $this-bar are now set This actually

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Martin Keckeis
Am 08.08.2013 15:12 schrieb Matthieu Napoli matth...@mnapoli.fr: Le 08/08/2013 13:11, Martin Keckeis a écrit : Am 08.08.2013 12:34 schrieb Jordi Boggiano j.boggi...@seld.be: On 08.08.2013 10:34, Leigh wrote: I'm not sure what problem this is really trying to solve, the boilerplate

[PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Sean Cannella
Everyone - Hi! Since this is my first post to this list, I'll introduce myself: I'm an engineer who has been working on HipHop VM in New York for the last half year or so after a long time working at Microsoft on business software and services in multiple hemispheres. I wanted to get the PHP

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Stas Malyshev
Hi! https://wiki.php.net/rfc/constructor-promotion 1. From the first glance, it doesn't seem clear how this syntax would interact with magic methods - i.e., if you have __get, would access to $make call it? If not, it's rather un-intuitive since the property is not defined in the class but

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Lars Strojny
Hi Sean, thanks for the RFC. Two other questions additionally to what Stas askes: - What about class type hints and array type hints? - If type hints are possible, doesn’t it look too much as real property type hinting? cu, Lars Am 07.08.2013 um 21:47 schrieb Sean Cannella se...@fb.com:

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Sean Cannella
Hi Stas, https://wiki.php.net/rfc/constructor-promotion 1. From the first glance, it doesn't seem clear how this syntax would interact with magic methods - i.e., if you have __get, would access to $make call it? If not, it's rather un-intuitive since the property is not defined in the class

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Sean Cannella
Hi Lars, thanks for the RFC. Two other questions additionally to what Stas askes: - What about class type hints and array type hints? Type hints continue to work as is: class Foo { public function __construct(public stdClass $foo, protected array $bar = null) {} } - If type hints are

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Stas Malyshev
Hi! Type hints continue to work as is: class Foo { public function __construct(public stdClass $foo, protected array $bar = null) {} } This is both very confusing syntax (since this would be only place in a language where public and type name can be mixed in the same construct) and it

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Stas Malyshev
Hi! In that case, __get() would not be called, since the property is defined on the class, just not in a traditional way. This behavior is not unprecedented however, as implicitly created public properties follow the same pattern: The code doing it is actually pretty explicit - you can see

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-07 Thread Hannes Magnusson
On Wed, Aug 7, 2013 at 12:47 PM, Sean Cannella se...@fb.com wrote: Everyone - Hi! Since this is my first post to this list, I'll introduce myself: I'm an engineer who has been working on HipHop VM in New York for the last half year or so after a long time working at Microsoft on business