Page 2 of 2

Re: Form code with honey pot not working?

Posted: Fri Nov 28, 2008 11:44 am
by John Cartwright
mmj wrote:I agree but empty is just as much as surpressor as @ and has no "semantics".
[/quote]
mmj wrote:
Jcart wrote:Actually empty() provides the added benefit of checking the variable has a (positive) value, so that is incorrect.
:?:

...
So you call not generating notices having no semantics? The @ error supressor temporarily sets the error reporting to 0, however empty() properly checks for the existance of the variable. I think it's pretty obvious which one lacks "semantics".

Re: Form code with honey pot not working?

Posted: Sat Nov 29, 2008 4:52 am
by mmj
Jcart wrote:However, calling empty() an error supressor simply isn't right. It's purpose is not to supress errors.
It's purpose is to check variables without throwing an error even if the variable or array key doesn't exist.

If you'd want to reimplement it you'd have to use error suppression (not saying that the PHP core does that).

Which means:

I would use

Code: Select all

(bool)$var
except I get an error if it isn't set.

So how do I suppress this error and yet get the same result?

Use empty!

So what is the real reason I'm using empty?

To suppress errors!

Is that so hard to understand? :banghead:
Jcart wrote:The @ error supressor temporarily sets the error reporting to 0, however empty() properly checks for the existance of the variable. I think it's pretty obvious which one lacks "semantics".
I wasn't comparing empty to @.

Re: Form code with honey pot not working?

Posted: Fri Dec 05, 2008 1:44 pm
by John Cartwright
empty() does not supress anything as it does not generate any errors.

Is that so hard to understand?

I'm confused by this whole topic now.