On Thu, Feb 24, 2011 at 5:00 AM, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> Hi!
>
>> You can do it like this. When an enum is defined:
>
> I'm not talking about implementation in the code of PHP engine. I'm talking
> about writing code with these things that wouldn't produce fatal errors in
> random places without you being able to prevent it and without checking
> before each function call. Compiled languages deal with it easily because
> they check these things on compile - if you try to send int variable where
> BlahBlah type is expected, the compiler bails out and you know it's a
> problem. Dynamic languages don't work that way.

except, that it could be handled by "thow new InvalidArgumentException()"
but we don't allow exceptions in core

-- 
Alexey Zakhlestin, http://twitter.com/jimi_dini
http://www.milkfarmsoft.com/

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

Reply via email to