On 9/19/12 2:01 PM, Andrew Faulds wrote:
Some other ideas:
$cb = (callable) $obj->bar;
Ah, but (callable) that won't work for global functions, since (callable) is a
cast, and
(callable) is not usable as a cast (at least in 5.4.7):
$a = (callable)'str'; // Parse error: syntax error, unexpected 'callable'
(T_CALLABLE)
This could work, and it makes sense to me at least.
$cb = {mysql_real_escape_string};
$cb = &{mysql_real_escape_string};
I'll add these possibilities to the RFC soon.
Steve
--
http://www.mrclay.org/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php