02-15-2008, 10:14 PM
|
#12 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Who says that empty() is slow and on what grounds? Also, empty does check all sorts of vars and arrays which basic comparison will not do. In the end it's about knowing what method to use for what circumstances.
P.S. The three equals symbols makes sure that the values are IDENTICAL. In other words, the comparison evaluates to TRUE if the left side is equal to the right, and they are both of the same type (string, integer, etc). For example:
PHP Code:
if (0 == 0.00) {
echo '0 is equal to 0.00';
} else {
echo '0 is not equal to 0.00';
}
if (0 === 0.00) {
echo 'and 0 is identical to 0.00';
} else {
echo 'but 0 is not identical to 0.00';
}
|
|
|
|