Hi!

On 7/10/11 12:02 PM, Johannes Schlüter wrote:
I can call it in some way. It won't ensure that the signature is
compatible with what I expect.

Well, it's like array type - you know it's an array but you can't know if it contains certain element that you expect, for example. As I'm not a big fan of strict typing in PHP anyway, I can't really defend this thing, but this is nothing new - other type restrictions don't guarantee you the code would work properly either, they only guarantee the type.


     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

Indeed, E_RECOVERABLE is more or less useless - they are only marginally better than E_ERROR since error handler could be invoked on it. I do not know why people think E_RECOVERABLE makes anything better.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to