50
Rooster
7y

Yea so I was creating registration form and I did this:

...

if ($pass != $passrepeat or
$passrepeat != $pass) {
# MAGIC
}

...

I think I should quit being a programmer..

Comments
  • 9
    Better be safe than sorry
  • 1
    @No-one Hahaha that would be fun !!
  • 1
    @gitpush Yea, you are probably right..
  • 3
    Ahem... It should be !== other than that i have zero issue with a double check. I've seen code do some weird shit.
  • 5
    Also my advice is don't use "and" and "or". They have really weird precedence. && and || are better and behave as expected.
  • 0
    @kurtr I thought that it doesn't make difference if you double check.
  • 1
    @devios1 Thanks for advice. :)
  • 1
    @Rooster it probably has zero effect but it doesn't hurt either. The comparison operator however really matters.
  • 0
    @kurtr I will try and not forget to use && and ||
  • 2
    You at least ask to repeat the password. I hate it when I only can type it once and probably have a typo in the password...
  • 0
    @Dollique Yea the worst..
  • 1
    You know, I think there is a way those conditions return different results due to their type
  • 1
    The problem is you are using php :P
Add Comment