PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Writing a constant first is a good habit because it protects you from the common mistype of "==" as "=". if($var = 1) will compile and the error can be tricky to find, but "if(1 = $var)" will report an error immediately.
stereofrog wrote:Writing a constant first is a good habit because it protects you from the common mistype of "==" as "=". if($var = 1) will compile and the error can be tricky to find, but "if(1 = $var)" will report an error immediately.
Ah, thanks for that. I knew it was for a good reason
I personally trust myself enough to know not to do that