On 23.07.2010, at 11:35, Harald Lapp wrote:
> Am 23.07.10 06:05, schrieb Adam Harvey:
>> On 23 July 2010 03:05, Harald Lapp wrote:
>>> i would like to ask what's the state of $this (and 'self') in closures.
>>> there seems to be no news on this topic for several month now. php 5.3.3 was
>>> just
Am 23.07.10 06:05, schrieb Adam Harvey:
On 23 July 2010 03:05, Harald Lapp wrote:
i would like to ask what's the state of $this (and 'self') in closures.
there seems to be no news on this topic for several month now. php 5.3.3 was
just released and still nothing has changed regarding this. so i
Am 23.07.10 06:05, schrieb Adam Harvey:
On 23 July 2010 03:05, Harald Lapp wrote:
i would like to ask what's the state of $this (and 'self') in closures.
there seems to be no news on this topic for several month now. php 5.3.3 was
just released and still nothing has changed regarding this. so i
On 23 July 2010 03:05, Harald Lapp wrote:
> i would like to ask what's the state of $this (and 'self') in closures.
> there seems to be no news on this topic for several month now. php 5.3.3 was
> just released and still nothing has changed regarding this. so i would like
> to ask, for which php r
Hi!
Also $this have been wildly discuss here, but the same discussion can be
apply to static/self.
self might be simple to figure out how to bind within a closure.
It can be bind to the name of the class where the closure is define.
I would guess self binds to the scope, and static binds to t
Hi,
Also $this have been wildly discuss here, but the same discussion can be
apply to static/self.
self might be simple to figure out how to bind within a closure.
It can be bind to the name of the class where the closure is define.
static is a more tricky one but it should be the same thing
Hi,
>> My suggestion is to wait until the 15th of January (that's one month
>> since I started this thread) and that should have been enough time of
>> everybody.
>
> So, it's 18th - are we moving forward with this?
Yes, Sorry, I've been extremely busy for the last two months, I'll get
back to t
Hi!
My suggestion is to wait until the 15th of January (that's one month
since I started this thread) and that should have been enough time of
everybody.
So, it's 18th - are we moving forward with this?
--
Stanislav Malyshev, Zend Software Architect
s...@zend.com http://www.zend.com/
(408)25
Hello again,
A quick summary of the votes so far (since 15th December):
internals@ votes:
0: (1) Alexey Zakhlestin
A: (1) Hannes Magnusson
C: (0) -
D: (0) -
A+: (2) Christian Seiler, Joey Smith
AS: (1) Stanislav Malyshev
---
5 votes
[AS is Stas' version with bin
I vote for (A). bind() and bindTo() seem messy to me. However, I
mostly vote for no implicit $this changes in closures (no
javascript-like behaviour), so (A+) approach would be much better than
(C) or (D). (0) case is not my choice, because I really would like to
see $this support in closures back.
On Tue, Dec 15, 2009 at 08:46:44PM +0100, Christian Seiler wrote:
> (A+): (A) + Closure::bind & Closure->bindTo for rebinding
> if this is wanted & the possibility to call a closure as an object
> method. (See last section of RFC for details)
+1 for "A+" with class scope option 2
I'm
Richard Quadling wrote:
How much of a use case is binding $this to closures (personally, I
think this is quite a common usage, but I've been using JavaScript so
maybe I've got the wrong head on).
But, if there are significant technical/internal issues with regard to
binding $this to closures, w
2009/12/15 Christian Seiler :
> Hello again,
>
>> Discuss away!
>
> I'm a little disappointed by the non-outcome of this debate. Very few
> people have responded and most of them seem to agree proposal (A) should
> be implemented, perhaps with the additional bind/bindTo as in my
> proposal and perh
On Tuesday 15 December 2009 1:46:44 pm Christian Seiler wrote:
> Hi Lukas,
>
> > Call for a vote. This time around people cannot claim to not have had
> > time to review the issue. Also back then we tried to play it safe
> > because of the short time before we were to release. This time there is
>
Christian Seiler wrote
>
> Hi Lukas,
>
> > Call for a vote. This time around people cannot claim to not have had
> > time to review the issue. Also back then we tried to play it safe
> > because of the short time before we were to release. This time there
> is
> > more time for this to mature if
2009/12/15 Ionut G. Stan :
> A+, but I'm not an internal dev.
>
>
> On 12/15/2009 21:46, Christian Seiler wrote:
>>
>> Hi Lukas,
>>
>>> Call for a vote. This time around people cannot claim to not have had
>>> time to review the issue. Also back then we tried to play it safe
>>> because of the shor
Hi,
Maybe I don't exactly understand the need for closureProperty(); also,
I haven't read the rfc ;-)
My understanding would be that you can treat it as a callable object, like so:
$a = function($msg) { echo $this->id, ": ", $msg, " [ calls: ",
++$this->calls, "]";
}
$a->id = 123;
$a("hello wor
A+, but I'm not an internal dev.
On 12/15/2009 21:46, Christian Seiler wrote:
Hi Lukas,
Call for a vote. This time around people cannot claim to not have had
time to review the issue. Also back then we tried to play it safe
because of the short time before we were to release. This time there
On 15.12.2009, at 22:46, Christian Seiler wrote:
> Ok, so then I call for a vote. Again, here are the options:
>
> (0): No $this in closures, keep it that way. (keep PHP 5.3 behavior)
I vote for (0)
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.
Hi,
>> Ok, so then I call for a vote. Again, here are the options:
>
> A+, no direct method calling (get/call problem would be messy)
I don't quite follow: Why A+ if no direct method calling? What would be
the point of allowing bindTo() if $obj->closureProp() doesn't work
anyway? If you don't wa
Hi!
> Ok, so then I call for a vote. Again, here are the options:
A+, no direct method calling (get/call problem would be messy)
one additional thing:
$a = static function () {}
should leave $this not bound (in case for some reason you don't want it
to be bound, e.g. to avoid keeping reference
On Tue, Dec 15, 2009 at 20:46, Christian Seiler wrote:
> (A): Original closures implementation:
> $this is always the object context at
> closure creation. No possibility to do
> $someObject->closureProperty(...) and thus
> no possibility to extend objects!
+1
Pre
On 15.12.2009, at 20:01, Christian Seiler wrote:
> Hello again,
>
>> Discuss away!
>
> I'm a little disappointed by the non-outcome of this debate. Very few
> people have responded and most of them seem to agree proposal (A) should
> be implemented, perhaps with the additional bind/bindTo as in
Hello again,
> Discuss away!
I'm a little disappointed by the non-outcome of this debate. Very few
people have responded and most of them seem to agree proposal (A) should
be implemented, perhaps with the additional bind/bindTo as in my
proposal and perhaps not.
The problem here is: (A) was exac
On Thu, Nov 19, 2009 at 4:29 PM, Jelrik van Hal wrote:
> Victor, I do wholeheartedly agree with you about the mess things will be
> when allowing $this to refer to different things in different contexts of
> calling the same closure (B, C and D): I think it'll prove very difficult to
> keep track
Hi
> so you can with $foo->$bar() or $foo()
You're talking about variable functions/methods. But that is not the
subject of discussion. Variable functions/methods are useful but
introduce mess. This is well-known and this feature exists in PHP for
a long time - so everybody should be condidered a
Hello.
Jelrik, I could easily show a real-world example where using $this in
closures could help. Consider Person class which has to verify that
email address is unique.
Suppose we have validation code in a single place and
filter_var_array() is used to check all the data:
class Person {
..
f
Hi!
If php-people really would like rebinding $this, I beleive this should
be done via method like Closure->bindTo() - to make the fact of
rebinding clear in the code.
However, there is a problem with rebinding $this - that was not
mentioned yet, I think.
This can be a problem, but since PHP
Victor Bolshov wrote:
Hi.
Personally, I beleive that (A) approach is the best: "bind $this to
the object scope at creation" and never change it, issue error when
$this is used where not available. It also seems to me like this way
it could be implemented with better performance, am I right?
Dyn
Hi!
That syntax made my eyes hurt, but I think really the problem is that
people want to dynamically add methods with $this in the closure
pointing the the object it has been attached too. Really I like A. but
We can add method to Closure class to allow that. See Closure::bind and
bindTo in
Hello,
On Wed, Nov 18, 2009 at 11:44 AM, Stanislav Malyshev wrote:
> I have very hard time imagining somebody that would be comfortable using
> such a construct. What happened to keeping it simple? And why every tiniest
> feature of every remotest imaginable use case has to be brought into the
>
Hi!
As for public/protected/private ...
$fn = function() use() bind() access(CLOSURE_PUBLIC |
CLOSURE_PROTECTED | CLOSURE_PRIVATE) {};
I have very hard time imagining somebody that would be comfortable using
such a construct. What happened to keeping it simple? And why every
tiniest feature
2009/11/16 Christian Seiler :
> Hi,
>
> since a few months have passed since the last discussion on this topic
> and perhaps people had time to gather some experience with the current
> closure implementation in PHP 5.3 I'd like to restart the debate on
> $this in closures and object extension.
>
>
Hi.
Personally, I beleive that (A) approach is the best: "bind $this to
the object scope at creation" and never change it, issue error when
$this is used where not available. It also seems to me like this way
it could be implemented with better performance, am I right?
Dynamically changing $this
Chris Stockton a écrit :
Hello,
On Tue, Nov 17, 2009 at 2:59 AM, Mathieu Suen
wrote:
Christian Seiler a écrit :
Hi,
since a few months have passed since the last discussion on this topic
and perhaps people had time to gather some experience with the current
closure implementation in PHP 5.3
Hello,
On Tue, Nov 17, 2009 at 2:59 AM, Mathieu Suen
wrote:
> Christian Seiler a écrit :
>>
>> Hi,
>>
>> since a few months have passed since the last discussion on this topic
>> and perhaps people had time to gather some experience with the current
>> closure implementation in PHP 5.3 I'd like t
Christian Seiler a écrit :
Hi,
since a few months have passed since the last discussion on this topic
and perhaps people had time to gather some experience with the current
closure implementation in PHP 5.3 I'd like to restart the debate on
$this in closures and object extension.
Foreword: The
37 matches
Mail list logo