It appears to be a recurring issue. In other words, PHP has a very nasty (and inconsistent) implementation of member variables.Is it happening specifically to this function or all of them ?
Problem is that this shouldn't be of any concern to a developer using PHP, rather than developing on the interpreter itself.Member calls and variables are on two separate lookup tables. ( ) automatically invokes a lookup in the method list, which doesn't have your closure since that has been assigned as a value. If you want to invoke on a member variable, then you need to call __invoke on the closure member variable.
$obj->lambda->__invoke( );
Half my brain is dedicated to memory structures, virtual tables (C++), interpreter/compiler expansions (especially Scala, and PHP magic methods), and garbage collectors. So I can tell you with certainty, ALL languages have these types of deep knowledge issues.Problem is that this shouldn't be of any concern to a developer using PHP, rather than developing on the interpreter itself.