Sam Barrow schrieb:
Well these errors can be handled like any other, as long as they don't
issue a fatal.
That's exactly my point. You need to handle them. So in pidgin PHP that
could look something like
function foo(int $foo) {}
try
{
foo($bar);
}
catch (WhateverException $e)
{
since $bar cannot be converted to int, do_whatever
}
Is that really betten than writing
if (!is_int($bar)) do_whatever
foo($bar)
or
function foo($foo)
{
if (!is_int($foo)) do_whatever
}
My point is: aside from the "academic purity" of more strictness, what
is the real benefit in this scenario? Any defensive coder will always
write explicit type checks to prevent runtime errors.
Regards,
Stefan
--
>e-novative> - We make IT work for you.
e-novative GmbH - HR: Amtsgericht München HRB 139407
Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch
http://www.e-novative.de - GnuPG Key: 0x7DB67F7F
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php