Bug #64761 [Wfx]: rebinding of closures doesn't work when they are declared in a static method

From: Date: Sat, 26 Mar 2016 11:49:29 +0000
Subject: Bug #64761 [Wfx]: rebinding of closures doesn't work when they are declared in a static method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200110@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64761&edit=1

 ID:                 64761
 Updated by:         nikic@php.net
 Reported by:        netmosfera at gmail dot com
 Summary:            rebinding of closures doesn't work when they are
                     declared in a static method
 Status:             Wont fix
 Type:               Bug
 Package:            *General Issues
 Operating System:   any
 PHP Version:        5.5.0beta4
 Block user comment: N
 Private report:     N

 New Comment:

@cpuidle: This bug has already been fixed in PHP 7.0.


Previous Comments:
------------------------------------------------------------------------
[2016-03-26 09:19:02] Cpuidle at gmx dot de

+1 for getting this fixed. At least the bindTo() behaviour is crazy.

------------------------------------------------------------------------
[2015-01-10 23:00:12] requinix@php.net

Related To: Bug #68792

------------------------------------------------------------------------
[2014-05-16 11:14:44] dave at shax dot com

I'm hitting this all the time. Very annoying.

I understand why the original Closure has static scope.

But if I'm using bindTo(), I'm explicitly saying I WANT the closure to have object scope
now, The restriction seems arbitrary.

------------------------------------------------------------------------
[2014-03-02 04:21:43] sjaillet at gmail dot com

What's the point of providing a bindTo() function if it's not for binding a
closure to what the developper needs to bind it to ?

Without any solid argument, it's clearly a BUGS !

------------------------------------------------------------------------
[2013-12-17 20:45:04] php at maisqi dot com

This behavior is counter-intuitive and I doubt there's a single other language that has such a
similar artificial constraint. PLease reconsider fixing this, or at least allow us to contribute a
patch to this.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=64761


--
Edit this bug report at https://bugs.php.net/bug.php?id=64761&edit=1


Thread (15 messages)

« previous php.bugs (#200110) next »