Boolean¶
A boolean is a value that is either true or false.
PHP’s boolean are constants. They may be prefixed by \\
, and are case-insensitive. They can’t be redefined in namespaces.
There are rules to convert any data to a boolean.
Booleans have a related scalar type : bool
. There is also a special false
type.
<?php
$a = True;
$b = \FALSE;
?>
Related : Type Juggling, Scalar Types