Gabor Hojtsy wrote:
Michael Favia wrote:
Karoly Negyesi wrote:
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. And by TRUE he means FALSE. Or possibly !isset() or !empty(). You get the point. To be clear the following two statements are both TRUE:
If something is not set or NULL, then isset() is FALSE. if something is not set or NULL or empty array, 0 or '' or '0' then empty() is FALSE. 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.
That is all.
Hah, and by FALSE, you mean TRUE ;) isset() cannot be FALSE the same time empty() is FALSE, which is what you have written above... Doh! Thats what I get for copy, paste, editing and not typing the silly thing out. Anyone know of a good email client with a built in php debugger? ;) Yes, my mistake please defer to that cheat sheet which basically says the above (if you switch my last booleans in each statement) in a much more coherent way.
-- Michael Favia michael@favias.org tel. 512.585.5650 http://michael.favias.org