Consider following code snippet:
$x = 1;
if ($x == '1') { echo 'a'; } 
if ($x == true) { echo 'b'; }
if ((bool)$x === true) { echo 'c'; } 
if ($x === true) { echo 'd'; } 
if ((int)$x === true) { echo 'e'; }
What will be the result of executing the code above?
Explanation
'==' automatic type conversion on comparing; '===' don't allow automatic type conversion on comparing;

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
PHP quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes