2011/7/10 Johannes Schlüter <johan...@schlueters.de>: > Hi, > > On Wed, 2011-06-08 at 12:04 +0200, Johannes Schlüter wrote: >> >> Having the behavior cleared I wonder how useful it is in practical >> terms. A class type hint guarantees me I can do a specific call to >> methods defined in the class/interface. The proposed type hint tells >> me >> I can call it in some way. It won't ensure that the signature is >> compatible with what I expect. >> >> function foo(callable $cb) { >> $cb(); >> } >> foo("strpos"); // This one in fact is illegal but won't be >> prevented >> >> But maybe this doesn't matter as type hints purely serve documentation >> (as E_RECOVERABLE are useless unless we make them Exceptions ...) >> while >> even for documentation purpose more information is needed. > > Any comments to this? - I didn't see an answer before the votes were > opened. >
Voting is open on this? I don't think I ever had the time to integrate all the Q&A from this thread to the RFC. If you typehint on Closure, you don't know if it takes 0 or 10 parameters either. I don't think that is the point to know that either. -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php