​Hi Rowan,​

On 17 September 2015 at 22:52, Rowan Collins <rowan.coll...@gmail.com>
wrote:

> Terry Cullen wrote on 17/09/2015 13:41:
>
>> Here is an example where exists would be useful;
>>
>
> You answered your own request:
>
> // I should have used property_exists() instead of isset().. wasn't
>> expecting a null..
>>
>
> We already have that function, so that's alright then! :)
>
> As I've said several times, we need to improve documentation around this,
> but "I didn't find the existing function, so I need a new function which
> will be no easier to find and won't work in most people's environments" is
> a pretty weak argument in favour of a language change.
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
​I agree that there is already ways around this issue, but I agree with Bob
that there is a hole that exists() would fill.  I my world where PHP is the
glue between JSON requests and database queries, ​exists() would be a
function I'd use way more the array_key_exists(), property_exists(),
isset() and empty().  Further, in some scenarios exists($foo->bar) would
replace isset($foo) && is_object($foo) && property_exists($foo, 'bar').

Reply via email to