This RFC uses a syntax that is forward-compatible with partial function
application. Should it not be accepted, I'll explore alternative syntax
possibilities.
Given the choice of syntax in this proposal (which I do like)... Is the
following (potentially future) use case precluded by the syntax (whether
or not you like it immediately ;) )?
Basically be able to:
1. be able to refer to an instance method statically (this is currently
an error)
2. allow late binding of $this/context/closure scope, either via
bindTo() or via Reflection setClosureThis() (does not exist)
class MyController {
public function myAction($name) {
return new Response("Hello, $name");
}
}
// Closure with no $this (to be filled in later)
$fn = MyController->myAction(...);
$controller = new MyController;
$response = ($fn->bindTo($controller))($params);
-ralph
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php