At 07:15 29/03/2003, Timm Friebe wrote:
On Thu, 2003-03-27 at 17:16, Timm Friebe wrote:
> I've implemented an additional feature for type hints that will throw an
> exception instead of bailing out in case an incorrect type is passed.
[...LONG disussion...]

After reading through a bunch of mails this generated, I get the idea
that most people here would be happier with an E_WARNING and the
function not being executed.

?!


How the heck can we even think about such a thing? When you call a function, you expect it to run. The code that follows it may rely on stuff that it has done. Not running it is simply not an option, I can't even begin to imagine the possible consequences of such an approach!

Type hints are shortcuts for instanceof. If you want to handle a situation where the function is passed the wrong arguments, don't use type hints, use instanceof. Or use the errors-for-exceptions mode that we may have.

Zeev


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



Reply via email to