If foo() is changed, the type hints should be removed. Most of the time
however, a function will not change its functionality enough to change
the purpose of the arguments.
On Thu, 2008-01-03 at 14:50 -0800, Stanislav Malyshev wrote:
> > type-hinting is asserting.
> > checking of types is needed only on interface-border points (where
>
> With strict checking, that means instead of calling:
> foo($bar);
> you'd have now to do:
> if(is_integer($bar)) {
> // stupid foo() call would blow up if passed not integer, so I have
> to manually handle it
> // oh wait, actually I don't have any way to handle it - I need
> foo() to be called to proceed
> // so let's just
> die("can't call foo() because \$bar is not integer");
> }
> foo($bar);
>
> Now how it's easier or makes application more stable? What happens if
> foo() is changed and now accepts both integers and strings? What happens
> if someone forgets to write a wrapper?
> --
> 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