Menu Riverview Church

IS_BOOL

Finds out whether a variable is a boolean

SYNTAX

is_bool ( mixed $var ) : bool

PARAMETERS

var

The variable being evaluated.

RETURN

Returns TRUE if var is a boolean, FALSE otherwise.

EXAMPLES

1

bool(false)
bool(true)

2

NULL
bool(false)

bool(false)
bool(true)

bool(true)
bool(true)

int(-9223372036854775808)
bool(false)

int(9223372036854775807)
bool(false)

int(0)
bool(false)

int(1)
bool(false)

int(23)
bool(false)

int(0)
bool(false)

int(0)
bool(false)

int(-1)
bool(false)

int(1)
bool(false)

int(-23)
bool(false)

int(23)
bool(false)

int(0)
bool(false)

int(1)
bool(false)

int(19)
bool(false)

int(0)
bool(false)

int(1)
bool(false)

int(35)
bool(false)

float(0)
bool(false)

float(1.1)
bool(false)

float(23.45)
bool(false)

float(0)
bool(false)

float(10000000000)
bool(false)

float(230000000000)
bool(false)

string(0) ""
bool(false)

string(1) "0"
bool(false)

string(1) "1"
bool(false)

string(2) "23"
bool(false)

string(2) "-0"
bool(false)

string(2) "+0"
bool(false)

string(2) "-1"
bool(false)

string(2) "+1"
bool(false)

string(3) "-23"
bool(false)

string(3) "+23"
bool(false)

string(2) "00"
bool(false)

string(2) "01"
bool(false)

string(3) "023"
bool(false)

string(3) "0x0"
bool(false)

string(3) "0x1"
bool(false)

string(4) "0x23"
bool(false)

string(3) "0.0"
bool(false)

string(3) "1.1"
bool(false)

string(5) "23.45"
bool(false)

string(4) "0e10"
bool(false)

string(4) "1e10"
bool(false)

string(5) "23e10"
bool(false)

string(4) "0abc"
bool(false)

string(4) "1abc"
bool(false)

string(5) "23abc"
bool(false)

string(5) "-0abc"
bool(false)

string(5) "+0abc"
bool(false)

string(5) "-1abc"
bool(false)

string(5) "+1abc"
bool(false)

string(6) "-23abc"
bool(false)

string(6) "+23abc"
bool(false)

string(5) "00abc"
bool(false)

string(5) "01abc"
bool(false)

string(6) "023abc"
bool(false)

string(6) "0x0abc"
bool(false)

string(6) "0x1abc"
bool(false)

string(7) "0x23abc"
bool(false)

string(6) "0.0abc"
bool(false)

string(6) "1.1abc"
bool(false)

string(8) "23.45abc"
bool(false)

string(7) "0e10abc"
bool(false)

string(7) "1e10abc"
bool(false)

string(8) "23e10abc"
bool(false)

string(3) "abc"
bool(false)

string(4) "abc0"
bool(false)

string(4) "abc1"
bool(false)

string(5) "abc23"
bool(false)

string(5) "abc-0"
bool(false)

string(5) "abc+0"
bool(false)

string(5) "abc-1"
bool(false)

string(5) "abc+1"
bool(false)

string(6) "abc-23"
bool(false)

string(6) "abc+23"
bool(false)

string(5) "abc00"
bool(false)

string(5) "abc01"
bool(false)

string(6) "abc023"
bool(false)

string(6) "abc0x0"
bool(false)

string(6) "abc0x1"
bool(false)

string(7) "abc0x23"
bool(false)

string(6) "abc0.0"
bool(false)

string(6) "abc1.1"
bool(false)

string(8) "abc23.45"
bool(false)

string(7) "abc0e10"
bool(false)

string(7) "abc1e10"
bool(false)

string(8) "abc23e10"
bool(false)

array(0) {
}
bool(false)

array(2) {
[0]=>
int(0)
[1]=>
int(1)
}
bool(false)

PHP