This is an old revision of the document!

Request for Comments: How to write RFCs

The problem

Frameworks have started to adopt Closures for callbacks, utilizing the 'Closure' typehint. That has an unfortunate sideeffect of requiring already-existing-methods to be wrapped into a closure calling that method.

The solution

Introducing a callable typehint.

The typehint would allow a string with a function name, an array composed of classname/obj+methodname, and a closure.


Previous discussions

Discussion summary
  • The only arguments against the idea came from Stas, making the argument;
    • 'callable' are nothing different then 'balanced binary tree' and 'readable file', and none of them make sense to have typehints for.
    • A “strict typing error” is hard to handle in user-space gracefully
  • Everyone else seem to like the idea.
  • As for the patch itself, Felipe pointed out that the patch is missing an method in ext/reflection to retrieve the typehint information.


  • June 7th 2011, Initial writeup
rfc/callable.1307454825.txt.gz · Last modified: 2017/09/22 13:28 (external edit)