On 9/04/11 12:45 AM, Martin Scotta wrote:
I just feels that !empty($arr['key']) or isset($arr['key']) do not express
the real meaning, instead I would choose to write array_key_exists('key',
$arr). It may be slower but it clearly express what I meant.

I don't like this. array_key_exists will return true for an array key
that exists but is set to null, which is rarely what is wanted (though
it sometimes is).

I agree that the variants with empty() aren't very good.

Just a single isset() variant seems like a good idea. I favour the ??:
syntax.

I liked the well-thought-out examples with assignment and chaining and
so on. For chaining, does associativity matter? (Too tired to figure it
out for myself right now!)

Ben.




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

Reply via email to