3

A boolean TRUE value is converted to the string "1". Boolean FALSE is converted to "" (the empty string).

Why isn't FALSE cast to "0"?

B Seven
  • 44,484
  • 66
  • 240
  • 385

1 Answers1

0

If you cast to an int, then to a string, it prints 0's..

$x=false;
print (string)(int)$x;

Prints 0. You can, of course, omit the string type cast as it's done by print anyway.

DanRedux
  • 9,119
  • 6
  • 23
  • 41