On Wed, Oct 17, 2012 at 1:07 PM, Stas Malyshev <smalys...@sugarcrm.com> wrote:
>> I see this argument crop up with every typehint discussion and just
>> don't understand it at all. Why would you want to check the variable
>> type everywhere? You just assign it and if it doesn't work, then you
>> get an error. Just like it should be. I mean, do you seriously check
>
> No, you don't get an error. You'd get an error in compiled language. In
> dynamic language, your client gets an error when his site is launched
> and instead of happy launch his users get white screens. To avoid that,
> you'd need to add checks - or just ship it as is and hope your unit
> tests were as good as you hoped they are (which they never are).

Still don't quite understand it. If the type check fails, there is a
high probability that either a) there will be an error lateron, so you
get the whitescreen anyways, just with worse debugging information or
b) something will work incorrectly in the following code, thus making
the application behave incorrectly (which is arguably worse than
giving a WSOD as that at least makes the issue obvious).

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

Reply via email to