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);
    }