Re: RFC: constructor argument promotion
| From: | Michael Wallner | Date: | Thu, 08 Aug 2013 18:47:07 +0000 |
| Subject: | Re: RFC: constructor argument promotion | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68449@lists.php.net to get a copy of this message | ||
On 8 August 2013 17:16, Leigh <leight@gmail.com> wrote:
> On 8 August 2013 14:12, Matthieu Napoli <matthieu@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
> passing the parameter directly into that property.
>
> With that style, why even limit it to the ctor?
>
> function mySetter(array $this->items) {}
Awww. No :-/
Sorry, I have no more words on that topic.
--
Regards,
Mike