This code is just a good argument *FOR* type hints. When foo is:
function foo(int $bar) {...}
and you want the code to die if $bar is not integer, then foo($bar) would be

Why would you want it? I wouldn't want my code to die, I would want it to work.

you have either an int or string representing an integer in $bar, then foo((integer)$bar) would work just well.

And then how exactly strict typing helps you? You can not control at development time if everybody uses (integer) or not, since being interpreted PHP has no static type checking. So only option to find it out is to leave a minefield behind hoping that testers and not actual users would be ones who make it blow up. What if testers fail to find it?
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to