0
<?php
$x = 8;
$y = 8.0;
echo ($x === $y); 
?>

When I change from === to == there is output 1(true) but why I don't receive any output while using ===?

kommoddo
  • 9
  • 1
  • 1
    Is the question about difference between === and == or outputting boolean values? – user3783243 Oct 07 '22 at 12:06
  • 1
    P.S. A `false` value doesn't show anything when you echo. Use `var_dump` instead of `echo` and you'll see the result: https://3v4l.org/2hhG2 – ADyson Oct 07 '22 at 12:08
  • Dumping `$x` and `$y` individually in the same way is also instructive - see https://3v4l.org/E07gI . Now, along with the "3 different equals" article linked above (in the blue box), you can hopefully understand why the `===` comparison returns `false` in this case. If there's still something you don't understand after that, please leave a comment below. – ADyson Oct 07 '22 at 12:10

0 Answers0