查找枚举key val是否存在
@param $val
@return bool
344112
public function IsExist($val){
        return array_key_exists($val , $this->cMap) or array_search($val , $this->cMap) !== false;
    }
213118
public static function boolean($val): bool
    {
        if (!\is_scalar($val)) {
            return false;
        }

        // $ret = filter_var($val, \FILTER_VALIDATE_BOOLEAN, $settings);
        if (($val = (string)$val) === '') {
            return true;
        }

        return false !== \stripos(Helper::IS_BOOL, '|' . $val . '|');
    }
415466
public static function base64url_decode($val)
    {
        return json_decode(
            base64_decode(str_pad(strtr($val, '~_', '+/'), strlen($val) % 4, '=', STR_PAD_RIGHT)),
            true
        );
    }
1064761
private static function iniGetBytes($val)
    {
        $val = trim(ini_get($val));
        if ($val != '') {
            $last = strtolower(
                $val{strlen($val) - 1}
            );
        } else {
            $last = '';
        }
        $val = (int) $val;
        switch ($last) {
            // The 'G' modifier is available since PHP 5.1.0
            case 'g':
                $val *= 1024;
            case 'm':
                $val *= 1024;
            case 'k':
                $val *= 1024;
        }

        return $val;
    }
779231
public function storageVal($val)
    {
        $mode = $this->storageMode();

        if ($mode === self::STORAGE_MODE_INT) {
            return $this->intVal($val);
        } else {
            return $this->stringVal($val);
        }
    }
410542
public function getBytes($val)
    {
        $val = trim($val);
        if ($val !== '') {
            $last = strtolower($val[strlen($val) - 1]);
            if (!is_numeric($last)) {
                $num = trim(substr($val, 0, -1));
                switch ($last) {
                    case 'g':
                        $num *= 1024;
                    case 'm':
                        $num *= 1024;
                    case 'k':
                        $num *= 1024;
                        $val = $num;
                        break;
                }
            }
        }

        return $val;
    }
273800
public static function isLuhn($val = null)
    {
        if (is_null($val)) {
            return null;
        }
        $_num = substr($val, 0, strlen($val)-1);
        return (bool) (intval($val) == intval($_num.self::getLuhnKey($_num)));
    }
187358
public final function set ($key, $val)
    {
        if (in_array($key, $this->getColumn())) {
            $this->record->{$key} = $val;
            return true;
        }

        return false;
    }
850809
public static function getCode($val)
    {
        switch($val) {
        case self::DKK:
            return 'dkk';
        case self::EUR:
            return 'eur';
        case self::NOK:
            return 'nok';
        case self::SEK:
            return 'sek';
        default:
            return null;
        }
    }
696553
protected function Eq( $val )
	{
		if  (! $val->getIsNumeric() ) return false;
		return  $this->ToInt( null ) == $val->ToInt( null );
	}
690518
function getValueCount( $val )
    {
        $val_cnt = false;

        if ( $val === null )
        {
            $val_cnt = 0;
        }
        else if ( $val === true || $val === false )
        {
            $val_cnt = (int)$val;
        }
        else if ( is_array( $val ) )
        {
            $val_cnt = count( $val );
        }
        else if ( is_object( $val ) and
                  method_exists( $val, "attributes" ) )
        {
            $val_cnt = count( $val->attributes() );
        }
        else if ( is_numeric( $val ) )
        {
            $val_cnt = $val;
        }
        else if ( is_string( $val ) )
        {
            $val_cnt = strlen( $val );
        }
        return $val_cnt;
    }
138820
protected function serializedValue($val)
    {
        if (is_scalar($val)) {
            return $val;
        } elseif ($val instanceof DateTimeInterface) {
            return $val->format('Y-m-d H:i:s');
        } else {
            return json_decode(json_encode($val), true);
        }
    }
669200
public function decrement($key, $val = 1)
    {
        return apc_dec($this->conf['prefix'] . $key, abs(intval($val)));
    }
1053064
public function index($key, $val)
    {
        $db = $this->load();
        foreach ($db as $index => $row) {
            if ($row[$key] === $val) {
                return $index;
                break;
            }
        }
        return -1;
    }
1181340
public function decrement($key, $val = 1)
    {
        return $this->hash($key)->decrBy($key, abs(intval($val)));
    }
951211
public function isSelected($val)
    {
        if ($this->isMulti()) {
            return in_array($val, $this->getValue());
        } else {
            return $val === $this->getValue();
        }
    }
26530
private function jsEncode($val)
    {
        if (is_null($val)) {
            return 'null';
        }
        if (is_bool($val)) {
            return $val ? 'true' : 'false';
        }
        if (is_int($val)) {
            return $val;
        }
        if (is_float($val)) {
            return str_replace(',', '.', $val);
        }
        if (is_array($val) || is_object($val)) {
            if (is_array($val) && (array_keys($val) === range(0, count($val) - 1))) {
                return '['.implode(',', array_map([$this, 'jsEncode'], $val)).']';
            }
            $temp = [];
            foreach ($val as $k => $v) {
                $temp[] = $this->jsEncode("{$k}").':'.$this->jsEncode($v);
            }

            return '{'.implode(',', $temp).'}';
        }
        // String otherwise
        if (strpos($val, '@@') === 0) {
            return substr($val, 2);
        }
        if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
            return $val;
        }

        return '"'.str_replace(['\\', '/', "\n", "\t", "\r", "\x08", "\x0c", '"'], ['\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'], $val).'"';
    }