Le 19/09/2015 14:25, Rowan Collins a écrit :

- a syntactic sugar for array_key_exists and property_exists, maybe called 
hasitem(); hasitem($foo['bar']) would check $foo has the item 'bar', but 
hasitem($foo) would be an error

The most important, IMO, is a more intuitive, readable alternative to array_key_exists(). Checking the existence of a plain var is important for completeness and should be available, but remains an edge case, and property_exists() seems sufficient.

Anyway, the problem we have with names like 'exists' or 'hasitem', is that they would become reserved names. So, they couldn't be used as function/method names anymore, creating an important BC break.

Regards

François

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

Reply via email to