30th December 2007 - 3 minutes read time
It is very easy to break a program with a simple typo. Instead of typing == when comparing two values you type = and actually assign a variable. This is an easy way to introduce a bug as you will not always notice it until your program doesn't work. There is an easy way of avoiding this.
By using the following syntax:
if(100 == $score){ }
Instead of the usual format:
It is very easy to break a program with a simple typo. Instead of typing == when comparing two values you type = and actually assign a variable. This is an easy way to introduce a bug as you will not always notice it until your program doesn't work. There is an easy way of avoiding this.
By using the following syntax:
if(100 == $score){ }
Instead of the usual format: