phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [phpGroupWare-developers] [patch] Fix for NOTICEs in preferences/cha


From: Dave Hall
Subject: Re: [phpGroupWare-developers] [patch] Fix for NOTICEs in preferences/changepassword.php
Date: Sun, 15 Jul 2007 17:49:14 +1000

On Sat, 2007-07-14 at 10:09 +0200, Maat wrote:
> Chris Weiss a écrit :
> > On 6/10/07, Sigurd Nes <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]