classes/phing/util/StringHelper.php
public static function isBoolean($s)
    {
        if (is_bool($s)) {
            return true; // it already is boolean
        }

        if ($s === "" || $s === null || !is_string($s)) {
            return false; // not a valid string for testing
        }

        $test = strtolower(trim($s));

        return in_array($test, array_merge(self::$FALSE_VALUES, self::$TRUE_VALUES), true);
    }
public static function isBoolean($s)
    {
        if (is_bool($s)) {
            return true; // it already is boolean
        }

        if ($s === "" || $s === null || !is_string($s)) {
            return false; // not a valid string for testing
        }

        $test = strtolower(trim($s));

        return in_array($test, array_merge(self::$FALSE_VALUES, self::$TRUE_VALUES), true);
    }
public static function isBoolean ( $ s ) { if ( is_bool ( $ s ) ) { return true ; // it already is boolean } if ( $ s === "" || $ s === null || ! is_string ( $ s ) ) { return false ; // not a valid string for testing } $ test = strtolower ( trim ( $ s ) ) ; return in_array ( $ test , array_merge ( self :: $ FALSE_VALUES , self :: $ TRUE_VALUES ) , true ) ; }
tests if a string is a representative of a boolean

@param bool|string $s

@return bool
tests if a string is a representative of a boolean