Always, always remember the double equals
Tuesday, February 21st, 2006 | Life
With PHP, Java, etc one of the most basic mistakes you can make is to do a comparission with one equals sign.
x = true
That is always going to equal true because these languages are too lazy to distinquish between assignment and comparission so if you don’t tell it to do a comparission using == it will do an assignment and therfore always come out true.
With PHP, Java, etc one of the most basic mistakes you can make is to do a comparission with one equals sign.
x = true
That is always going to equal true because these languages are too lazy to distinquish between assignment and comparission so if you don’t tell it to do a comparission using == it will do an assignment and therfore always come out true.