Re: PHP 7.1 - Address PHPSadness #28?

From: Date: Sat, 19 Sep 2015 17:44:01 +0000
Subject: Re: PHP 7.1 - Address PHPSadness #28?
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-88376@lists.php.net to get a copy of this message
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

« previous php.internals (#88376) next »