On 9/19/12 1:19 PM, Andrew Faulds wrote:
I completely agree. How about &function_name? Resembles C (function pointers!), 
and unless
I'm getting confused, it isn't currently legal syntax for something else.

$cb = & Foo::doSomething;
$cb = & foo_doSomething;
$cb = & $obj->doSomething;

The last looks like a reference to a property, though having verb method names would help distinguish. Not sure if the ambiguity would make this difficult to implement.

Some other ideas:

$cb = (callable) $obj->bar;
$cb = callable $obj->bar;
$cb = callable::$obj->bar;
$cb = $obj->bar::callable;

Steve
--
http://www.mrclay.org/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to