Re: Callable type
| From: | Johannes Schlüter | Date: | Tue, 07 Jun 2011 23:39:41 +0000 |
| Subject: | Re: Callable type | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53189@lists.php.net to get a copy of this message | ||
On Tue, 2011-06-07 at 12:12 -0700, Stas Malyshev wrote:
> Hi!
>
> > https://wiki.php.net/rfc/callable
>
> It is good there's an RFC. However it seems to lack code examples. I
> understand it may be obvious to the proposers how it looks like, but
> it'd be nice to have the actual example there as it is done nearly
> everywhere else.
The RFC is missing information about what happens in codebases which
already have a "callable" type declared. Will that be prevented or will
they hit a runtime error? ("callable expected, callable type found")
What about default values? Will
function foo(callback $cb = 'strpos') { }
be valid?
The information on reflection is limited. what shall
Reflection::Parameter::getTypehint() return? Will that method allow to
differ between a class type and this "magic"?
What about ARGINFO? Will internal functions be able to define this type
via ARGINFO? How will this be reported in
php --rf function?
johannes