Nuances of Comparing Data Types in PHP
Pay attention to the following code:
<?php
if (0 == '') {
echo '+++';
} else {
echo '---'; // this will execute
}
?>
And to the following:
<?php
if (0 == '0') {
echo '+++'; // this will execute
} else {
echo '---';
}
?>