Adding \Closure::isBindable()
| From: | Julien Pauli | Date: | Wed, 31 Jul 2013 13:13:54 +0000 |
| Subject: | Adding \Closure::isBindable() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-68348@lists.php.net to get a copy of this message | ||
Hi all.
From a recent discussion, we noticed that there is no easy user-level way
to know if a given closure is bindable or not.
Sure, the debatte about https://bugs.php.net/bug.php?id=64761 is still
open, I dont see why a static closure is not bindable, knowing that a
global scope defined closure is, and it can contain $this.
I'm feeling like there is a non sense in this design, but anyway.
To prevent such code :
https://github.com/atoum/atoum/blob/master/classes/test/adapter/invoker.php#L191
,
I added \closure::isbindable().
It's at https://github.com/jpauli/php-src/compare/static-closures
, if you
have thoughts ?
Julien.Pauli