class SplBool extends SplEnum (View source)

The SplBool class is used to enforce strong typing of the bool type.

Constants

__default

false

true

Methods

__construct(mixed $initial_value = self::__default, bool $strict = true)

Creates a new value of some type

from  SplType
array
getConstList(bool $include_default = false)

Returns all consts (possible values) as an array.

from  SplEnum

Details

__construct(mixed $initial_value = self::__default, bool $strict = true)

Creates a new value of some type

Parameters

mixed $initial_value
bool $strict

If set to true then will throw UnexpectedValueException if value of other type will be assigned. True by default

array getConstList(bool $include_default = false)

Returns all consts (possible values) as an array.

Parameters

bool $include_default

Whether to include __default constant (property). False by default.

Return Value

array