On Sat, 2007-07-14 at 10:09 +0200, Maat wrote:
> Chris Weiss a écrit :
> > On 6/10/07, Sigurd Nes <[EMAIL PROTECTED]> wrote:
> >> Hi,
> >> if (isset($array['key']) && $array['key'])
> >
> > what if it's value evaluates to false?
> > I do agree that it needs more than just isset() though.
> >
> >
> valid from php 4.0.7 :
> 
> if ( @is_array($array) && |array_key_exists('key', $array))

array_key_exists is an expensive operation.  Checking isset and check
the value is faster and cheaper.  Also @is_array is a bad idea, it can
hide problems like $array being a typo.

Cheers

Dave



_______________________________________________
phpGroupWare-developers mailing list
phpGroupWare-developers@gnu.org
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers

Reply via email to