Re: Re: 1 last error to fix before the application is done!

From: Date: Tue, 14 Oct 2008 13:24:17 +0000
Subject: Re: Re: 1 last error to fix before the application is done!
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-281869@lists.php.net to get a copy of this message
> Personally, I very rarely see the point in using array_key_exists... It's a function call > and has overhead where as isset() and empty() are language constructs and (I would hope) are much > more efficient (although I've not done any benchmarks) # i don't know what's wrong with this .. $foo = array(); $foo['bar'] = null; if (array_key_exists('bar', $foo)) { switch ($foo['bar']) { case true: //do something break 1; default: //do something else } } # if that's causing more overhead then let me see your benchmark, then i believe it

« previous php.general (#281869) next »