27 Mar
2007
27 Mar
'07
11:27 p.m.
On 3/27/07, Karoly Negyesi <karoly@negyesi.net> wrote:
b) Do not introduce notices with your patches. If you want to write if ($foo) or $foo ? use if(!empty($foo)). c) if (count($foo)) and if (sizeof($foo)) are much slower than if (!empty($foo))
empty and isset are the same speed and do not throw notices. if something is not set or NULL, then isset is TRUE. if something is not set or NULL or empty array, 0 or '' or '0' then empty is TRUE.
My favorite reference for PHP's comparison madness is at http://www.php.net/manual/en/types.comparisons.php. -- Neil Drumm http://delocalizedham.com