Hi!

> My proposal is simple: behave as an inline type hint. The same type hints 
> you have in arguments lists, but inline. The use case is "I want to make 
> sure this value is of this type" and a side benefit is the IDE can know the 
> variable is of this type too (for autocompletion purposes).

What's wrong with instanceof? You can then throw fatal error if you
want, it's just two lines:
if(!($foo instanceof Bar)) {
  trigger_error(E_USER_ERROR, "Wrong foo!");
}

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to