Conversation started Jan 5, 2013 at 2:43.
Jan 5, 2013 02:43
 
1 hour later…
Jan 5, 2013 04:03
@toscho I was just converting the conditions to Yoda conditions in one of my plugins, and I was shocked to learn that in a few cases I had only been using one equals sign when comparing!
Jan 5, 2013 04:27
@bungeshea This cannot happen if you make it a habit to write always three ===, ie. run a strict comparison.
@toscho Is there ever a situation where you shouldn't run a strict comparison? I wasn't sure if using it all the time would mess up something.
@bungeshea Yes, look what WordPress does with pre_get_option_ . $option. :D
And in one of my plugins I am using -1 as an ID for a ghost user.
I am relying in weak comparisons in these cases.
@toscho So the 'default' comparison operator I should use is ===, not ==?
yes
Okay, thanks
:)
Jan 5, 2013 04:42
But $_REQUEST values are either array or string, never integer, even if you want an integer.
That's what intval() is for
 
Conversation ended Jan 5, 2013 at 4:44.