On 19/09/12 19:21, Steve Clay wrote:
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.
Yes, the problem is that it would add a special syntax case, where
(cast)identifier, in this case, uses a function name, not an expression.
This is bad.
--
Andrew Faulds
http://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php