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
  • 42,103
  • 65
  • 226
  • 370

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
  • 8,585
  • 5
  • 22
  • 41