Hi everyone,
having worked a bit with anonymous classes these days, the current
boilerplate is really high to inject some local context into them.
So big +1 from me for the target.
On the proposed syntax, I really prefer Nikita's proposal:
return new class {
> private $a = $var;
>
tw.
> >
> >
> > Den 2016-04-26 kl. 10:25, skrev Joe Watkins:
> >
> >> Morning internals,
> >>
> >> Just to be clear, the implementation is now in good shape, the
> >> discussion may continue.
> >>
> >> Attached is messag
entation is now in good shape, the
>> discussion may continue.
>>
>> Attached is message from a confused contributor ... sorry about the
>> confusion :)
>>
>> Cheers
>> Joe
>>
>> -- Forwarded message --
>> From: Yasuo
pr 26, 2016 at 9:13 AM
Subject: Re: [PHP-DEV] RFC: Anonymous Class Lexical Scope
To: Joe Watkins <pthre...@pthreads.org>
Hi Joe,
Since you seem to pause this RFC activity for now, I'm sending this
mail only to you.
On Wed, Apr 20, 2016 at 3:01 PM, Joe Watkins <pthre...@pthread
e: Tue, Apr 26, 2016 at 9:13 AM
Subject: Re: [PHP-DEV] RFC: Anonymous Class Lexical Scope
To: Joe Watkins <pthre...@pthreads.org>
Hi Joe,
Since you seem to pause this RFC activity for now, I'm sending this
mail only to you.
On Wed, Apr 20, 2016 at 3:01 PM, Joe Watkins <pthre...@pthr
Oh, I fixed it ... I think ... carry on ...
Cheers
Joe
On Wed, Apr 20, 2016 at 7:01 AM, Joe Watkins wrote:
> Can we just halt this conversation for a few days.
>
> That implementation is totally and utterly wrong, it's so obvious this
> morning ... I'm almost
Can we just halt this conversation for a few days.
That implementation is totally and utterly wrong, it's so obvious this
morning ... I'm almost embarrassed.
I must say that of all the suggestions made so far for syntax, I still
prefer use().
While the idea to allow symbols and expressions is
I'm not sure it matters, but there is some precedent for this in
JavaScript/ES6:
function foo(bar) {
return new class {
myBar = bar;
getBar() {
return this.myBar;
}
}();
}
console.log(foo('hello').getBar()); // "hello"
(You can actually reference
Hi Nikita,
I was thinking some more about your suggestion:
Nikita Popov wrote on 19/04/2016 15:18:
$foo = 42;
return new class {
private $bar = $foo;
public function getBar() { return $this->bar; }
}
If we allowed this, would it make sense to also allow it in named
classes? This
Nikita Popov wrote on 19/04/2016 15:18:
I'd like to suggest an alternative syntax:
$foo = 42;
return new class {
private $bar = $foo;
public function getBar() { return $this->bar; }
}
That is, allow properties inside the anonymous class to be initialized
based on values from the
On 04/19/2016 05:18 PM, Nikita Popov wrote:
On Tue, Apr 19, 2016 at 3:31 PM, Joe Watkins wrote:
Morning Internals,
Please review the following RFC:
https://wiki.php.net/rfc/lexical-anon
A look at the patch from those of you that do that would be good
On 19/04/16 16:18, Nikita Popov wrote:
On Tue, Apr 19, 2016 at 3:31 PM, Joe Watkins wrote:
Morning Internals,
Please review the following RFC:
https://wiki.php.net/rfc/lexical-anon
A look at the patch from those of you that do that would be good :)
On Tue, Apr 19, 2016 at 3:31 PM, Joe Watkins wrote:
> Morning Internals,
>
> Please review the following RFC:
>
> https://wiki.php.net/rfc/lexical-anon
>
> A look at the patch from those of you that do that would be good :)
>
Hey Joe,
The syntax and semantics
Morning Internals,
Please review the following RFC:
https://wiki.php.net/rfc/lexical-anon
A look at the patch from those of you that do that would be good :)
Cheers
Joe
14 matches
Mail list logo