[dev] CODING_STANDARDS / isset()
Jan Schneider
jan at horde.org
Tue Mar 25 11:56:04 PST 2003
Quoting Marko Djukic <marko at oblo.com>:
> this seems to be a bit confusing:
> (line 512)
> d. Use array_key_exists() when you want to check if an array key is
> defined but it's OK if the value is false or null:
>
> which seems to imply that in difference to the previous ways for testing
> a
> variable, this one also accepts false as a value.
>
> when:
> $t['param'] = false;
> var_dump(isset($t['param']));
>
> gives the result 'true', meaning isset() does detect an array key having
> the
> value false, and we do not have to rely on array_key_exists for these
> situations. so the only difference would be that array_key_exists() would
> also
> accept NULL as a value and still determine that an array key is defined.
>
> committed a variation, if the way i understood things is ok.
Makes sense to me.
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
More information about the dev
mailing list