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;
PHP
PHP Quiz
Start Quiz

or Read more about PHP Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback