Re: $arr = array('Hello', 'world'); $arr();
| From: | Hannes Magnusson | Date: | Mon, 06 Jun 2011 14:34:01 +0000 |
| Subject: | Re: $arr = array('Hello', 'world'); $arr(); | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53028@lists.php.net to get a copy of this message | ||
On Sun, Jun 5, 2011 at 17:52, Felipe Pena <felipensp@gmail.com> wrote:
> Hi all,
> Reading our bug tracker I noticed a good feature request [1] from 2009 which
> points to an interesting feature that I think makes sense for us, since we
> are now working with $f() using objects and strings, and the array('class',
> 'method') is an old known for call_user_func()-like functions.
I like it.
I also think we should implement "callable" typehint.
A lot of framworks are now adopting Closure as a typehint for that,
which is annoying due to the fact you have to wrap anything else in a
closure just to pass that typehint.
Essentially the callable typehint would be the same as is_callable($arg, true);
That means I can pass in any string with a function name, an array
(with class+methodname), and a closure.
-Hannes