I searched on StackOverflow and Google and I can\'t find the answer to this question:
Should we always use the triple equal in PHP for validation?
For exampl
It depends entirely on the script you're writing, there's not one correct answer for this. Having said that, there aren't many situations where you don't already know the type of the variable (except perhaps user input).
This is the reason I stick to using ==
and only use ===
when there could be more than one type of the variable.
The ==
is fine most of the time, it wouldn't have been invented if you weren't supposed to use it :)