Why is true output 1, but false but nothing output it?
$a =true;
";
echo $a;
Echo '
';
$a =false;
";
echo $a;
?>
If it turns out to be 1 output, then the false should be converted to 0 output.
------Solution--------------------
According to its rules, this is programming.
------Solution--------------------
$a = false;
Var_dump ($a);
Output:
BOOL (FALSE)
Recommended for debugging with Var_dump ()
------Solution--------------------
That's what the author of the language wrote, and when you write a language so that false output 0,true nothing output, then someone asked why false output 0, and true nothing output it
------Solution--------------------
The Boolean value of PHP is true and false; echo true; 1 echo false No output content
PHP, like C, 0 means false; not 0 means true;
$a = 1;
";
echo $a;
Echo '
';
$a = 0;
";
echo $a;
------Solution--------------------
For numeric types, false is really 0, and for string, False is empty, although 0 of the number equals the null of the string, but it cannot be said that the bool conversion string is 0;
Var_dump ((int) false);
Var_dump ((string) false);
------Solution--------------------
Citation:
The author of the language wrote that, and when you write a language to let false output 0,true nothing output, then someone asked why false output 0, and true nothing output it
..........