/**
 * Encode to (X)HTML entities or entities of given type.
 *
 * @param string $string_
 * @param string $charset_
 * @param integer $type_
 *
 * @return string
 */
function escape($string_, $charset_ = null, $type_ = ENT_XHTML, $flags_ = ENT_QUOTES)
{
    static $debug;
    static $charset;
    if (null === $debug) {
        $debug = \env\debug();
    }
    if (null === $charset_) {
        if (null === $charset) {
            $charset = libstd_get('charset', 'env');
        }
        $charset_ = $charset;
    }
    if ($debug) {
        $flags_ |= ENT_SUBSTITUTE;
    }
    return htmlentities($string_, $type_ | $flags_, $charset_, false);
}
 /**
  * Deactivate debugging.
  */
 public static function deactivate()
 {
     \env\debug(false);
     self::$m_active = false;
     self::notifyListeners();
 }