Boolean settype ( $copy, 'bool' ) (bool) filter_var (…) filter_var (…) ‡1 ‡2 CastToType::_bool ( $x, false, false ) ‡3 is_bool() == true === true == 1 == 'true' == false === false == 0 == 'false' if( $x ) {..} if( ! $x ) {..} Boolean
Boolean settype ( $copy, 'bool' ) (bool) filter_var (…) filter_var (…) ‡1 ‡2 CastToType::_bool ( $x, false, false ) ‡3 is_bool() == true === true == 1 == 'true' == false === false == 0 == 'false' if( $x ) {..} if( ! $x ) {..} Boolean
$x = null : ( = NULL )
false false false false null false false false false false true false true false false true $x = null : ( = NULL )
$x = null : ( = NULL )
false false false false null false false false false false true false true false false true $x = null : ( = NULL )
$x = bool : ( = false )
false false false false false true false false false false true true true false false true $x = bool : ( = false )
$x = bool : 1 ( = true )
true true true true true true true true true true false false false true true false $x = bool : 1 ( = true )
$x = int : 1
true true true true true false true false true false false false false false true false $x = int : 1
$x = int : 0
false false false false false false false false false true true false true true false true $x = int : 0
$x = int : -1
true true false null null false true false false false false false false false true false $x = int : -1
$x = int : 42
true true false null null false true false false false false false false false true false $x = int : 42
†i8$x = int : 13369593
true true false null null false true false false false false false false false true false †i8$x = int : 13369593
†i9$x = int : 42
true true false null null false true false false false false false false false true false †i9$x = int : 42
†ia$x = int : 57
true true false null null false true false false false false false false false true false †ia$x = int : 57
$x = float : 1.3
true true false null null false true false false false false false false false true false $x = float : 1.3
$x = float : 0.005
true true false null null false true false false false false false false false true false $x = float : 0.005
$x = float : 0
false false false false false false false false false true true false true true false true $x = float : 0
$x = float : -1.3
true true false null null false true false false false false false false false true false $x = float : -1.3
†f5$x = float : NAN
true true false null null false true false false false false false false false true false †f5$x = float : NAN
†f6$x = float : NAN
true true false null null false true false false false false false false false true false †f6$x = float : NAN
†f7$x = float : -INF
true true false null null false true false false false false false false false true false †f7$x = float : -INF
†f8$x = float : INF
true true false null null false true false false false false false false false true false †f8$x = float : INF
†f9$x = float : 123450000
true true false null null false true false false false false false false false true false †f9$x = float : 123450000
$x = string[0] : ‘’
false false false false null false false false false false true false true false false true $x = string[0] : ‘’
$x = string[1] : ‘ ’
true true false false null false true false false false false false true false true false $x = string[1] : ‘ ’
$x = string[2] : ‘ 1’
true true true true true false true false true false false false false false true false $x = string[2] : ‘ 1’
$x = string[3] : ‘ 3 ’
true true false null null false true false false false false false false false true false $x = string[3] : ‘ 3 ’
$x = string[1] : ‘1’
true true true true true false true false true false false false false false true false $x = string[1] : ‘1’
$x = string[1] : ‘0’
false false false false false false false false false false true false true false false true $x = string[1] : ‘0’
$x = string[2] : ‘-1’
true true false null null false true false false false false false false false true false $x = string[2] : ‘-1’
$x = string[2] : ‘42’
true true false null null false true false false false false false false false true false $x = string[2] : ‘42’
$x = string[3] : ‘1.3’
true true false null null false true false false false false false false false true false $x = string[3] : ‘1.3’
$x = string[3] : ‘0.0’
true true false null null false true false false false false false true false true false $x = string[3] : ‘0.0’
$x = string[6] : ‘-1.305’
true true false null null false true false false false false false false false true false $x = string[6] : ‘-1.305’
$x = string[4] : ‘true’
true true true true true false true false false true false false true false true false $x = string[4] : ‘true’
$x = string[5] : ‘false’
true true false false false false true false false false false false true true true false $x = string[5] : ‘false’
$x = string[4] : ‘null’
true true false null null false true false false false false false true false true false $x = string[4] : ‘null’
$x = string[6] : ‘123str’
true true false null null false true false false false false false false false true false $x = string[6] : ‘123str’
$x = string[6] : ‘str123’
true true false null null false true false false false false false true false true false $x = string[6] : ‘str123’
$x = string[10] : ‘123, "str"’
true true false null null false true false false false false false false false true false $x = string[10] : ‘123, "str"’
$x = string[2] : ‘on’
true true true true true false true false false false false false true false true false $x = string[2] : ‘on’
$x = string[3] : ‘off’
true true false false false false true false false false false false true false true false $x = string[3] : ‘off’
$x = string[3] : ‘yes’
true true true true true false true false false false false false true false true false $x = string[3] : ‘yes’
$x = string[2] : ‘no’
true true false false false false true false false false false false true false true false $x = string[2] : ‘no’
$x = string[8] : ‘0xCC00F9’
true true false null null false true false false false false false false false true false $x = string[8] : ‘0xCC00F9’
$x = string[4] : ‘0123’
true true false null null false true false false false false false false false true false $x = string[4] : ‘0123’
$x = array()
false false array()
array()
null false false false false false true false false false false true $x = array()
$x = Array: (
    [1 (int)] => string[6] : ‘string’
)
true true Array: (
  [1] => b false
)
Array: (
  [1] => null
)
Array: (
  [1] => null
)
false true false false false false false false false true false $x = Array: (
    [1 (int)] => string[6] : ‘string’
)
$x = Array: (
    [0 (int)] => bool : ( = false )
    [1 (int)] => int : 1
    [2 (int)] => float : 1.3
    [3 (int)] => string[6] : ‘123str’
    [4 (int)] => string[6] : ‘str123’
    [5 (int)] => null : ( = NULL )
)
true true Array: (
  [0] => b false
  [1] => b true
  [2] => b false
  [3] => b false
  [4] => b false
  [5] => b false
)
Array: (
  [0] => b false
  [1] => b true
  [2] => null
  [3] => null
  [4] => null
  [5] => b false
)
Array: (
  [0] => b false
  [1] => b true
  [2] => null
  [3] => null
  [4] => null
  [5] => null
)
false true false false false false false false false true false $x = Array: (
    [0 (int)] => bool : ( = false )
    [1 (int)] => int : 1
    [2 (int)] => float : 1.3
    [3 (int)] => string[6] : ‘123str’
    [4 (int)] => string[6] : ‘str123’
    [5 (int)] => null : ( = NULL )
)
$x = Object: (
    Class: stdClass (
    )
)
true true false null null false true false true
#2 )
false false false false
#2 )
false true false $x = Object: (
    Class: stdClass (
    )
)
$x = Object: (
    Class: TestObjectToString (
        property: test3 = string[11] : ‘some string’
        property: test1 = null : ( = NULL )
        property: test2 = bool : 1 ( = true )
        method: __toString
        method: print_it
    )
)
true true false null null false true false true
#2 )
false false false false
#2 )
false true false $x = Object: (
    Class: TestObjectToString (
        property: test3 = string[11] : ‘some string’
        property: test1 = null : ( = NULL )
        property: test2 = bool : 1 ( = true )
        method: __toString
        method: print_it
    )
)
$x = resource : Resource id #10 ( = RESOURCE )
true true false null null false true false false false false false false false true false $x = resource : Resource id #10 ( = RESOURCE )
$x = Object: (
    Class: SplBool (
        property: __default = bool : ( = false )
        method: getConstList
        method: __construct
    )
)
false false false null false false false false false false true false true false false true $x = Object: (
    Class: SplBool (
        property: __default = bool : ( = false )
        method: getConstList
        method: __construct
    )
)
$x = Object: (
    Class: SplBool (
        property: __default = bool : 1 ( = true )
        method: getConstList
        method: __construct
    )
)
true true false null true false true false true true false false false true true false $x = Object: (
    Class: SplBool (
        property: __default = bool : 1 ( = true )
        method: getConstList
        method: __construct
    )
)