验证值是否是一个自然数组 list (key是从0自然增长的)
@param array|mixed $val
@return bool
197087
public static function isList($val): bool
    {
        if (!\is_array($val) || !isset($val[0])) {
            return false;
        }

        /** @var array $val */
        $keys = \array_keys($val);

        return \array_keys($keys) === $keys;
    }
1252040
public static function isList(array $array): bool
	{
		$count = count($array);

		$range = $count
			? range(0, $count - 1)
			: [];

		$keys = array_keys($array);

		return $keys === $range;
	}
492831
public function set($val)
    {
        $code = $this->get($val);

        if ($code) {
            $this->current[] = $code;

            return true;
        }

        return false;
    }
559662
public static function max($val, $max)
	{
	    if (is_array($max)) {
	        if (!isset($max['max'])) {
	            throw new \InvalidArgumentException('The $max argument must have "max" key');
	        }
	        $max = $max['max'];
	    }

	    return $val <= $max;
	}
92767
protected function _applyFilter(&$val)
    {
        if (is_array($val)) {
            foreach($val as $key => &$item) {
                $this->_applyFilter($item);
            }
        } else {
            foreach($this->filters as $filter) {
                $val = $filter($val);
            }
        }
    }
1123361
public function deleteFromList($key_array = array())
    {
        if (empty ($key_array))
            return false;

        foreach ($key_array as $key_del) {
            if (empty ($this->cacheListing)) {
                break;
            }

            foreach ($this->cacheListing as $key) {
                if (strpos(strtolower($key), strtolower($key_del) !== false)) {
                    $this->delete($key);
                }
            }
        }

        return true;
    }
459862
public function _decode($val) {
		if (!is_string($val)) {
			return $val;
		}

		$decoded = json_decode($val, $this->_config['decodeParams']['assoc'], $this->_config['decodeParams']['depth'], $this->_config['decodeParams']['options']);

		if ($decoded === false) {
			return false;
		}
		if ($this->_config['decodeParams']['assoc']) {
			$decoded = (array)$decoded;
		}
		if ($this->_config['output'] === 'param') {
			$decoded = $this->_toParam($decoded);
		} elseif ($this->_config['output'] === 'list') {
			$decoded = $this->_toList($decoded);
		}
		return $decoded;
	}
879409
protected function _where($key, $val=[]): array
	{
		$where = [];
		$pairs = [];

		if (is_scalar($key))
		{
			$pairs[$key] = $val;
		}
		else
		{
			$pairs = $key;
		}

		foreach($pairs as $k => $v)
		{
			$where[$k] = $v;
			$this->state->appendWhereValues($v);
		}

		return $where;
	}
1338787
public static function isEmpty($val): bool
    {
        if (\is_string($val)) {
            $val = \trim($val);

        } elseif (\is_object($val)) {
            $val = \get_object_vars($val);
        }

        return $val === '' || $val === null || $val === [];
    }
839285
public function exists($field, $val)
    {
        $db = $this->load();
        $result = false;
        foreach ($db as $index => $row) {
            if ($row[$field] === $val) {
                $result = true;
            }
        }
        return $result;
    }
784144
public static function isMap($val): bool
    {
        if (!\is_array($val)) {
            return false;
        }

        /** @var array $val */
        $keys = \array_keys($val);

        return \array_keys($keys) !== $keys;
    }
530398
public function contains(array $list)
    {
        phpCAS::traceBegin();
        $count = 0;
        foreach ($this->_chains as $chain) {
            phpCAS::trace("Checking chain ". $count++);
            if ($chain->matches($list)) {
                phpCAS::traceEnd(true);
                return true;
            }
        }
        phpCAS::trace("No proxy chain matches.");
        phpCAS::traceEnd(false);
        return false;
    }
1094162
public function arrayToBinary($val)
    {
        $saved_object_count = $this->writtenObjectCount++;

        $bdata = self::typeBytes("a", count($val->getValue())); // a is 1010, type indicator for arrays

        foreach ($val as $v) {
            $bval = $v->toBinary($this);
            $bdata .= self::packItWithSize($this->objectRefSize, $bval);
        }

        $this->objectTable[$saved_object_count] = $bdata;
        return $saved_object_count;
    }
960656
public function exsitsIn($array, $val)
	{
		foreach ($array as $key => $value) {
			$keys =  explode('|', $value);
			foreach ($keys as $k) {
				$recs = DB::table($key)->where($k, $val)->get();
				if(count($recs)) return true;
			}	
		}

		return false;
	}
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)));
    }
103339
function find($key=NULL,$val=NULL) {
		$out=[];
		if (isset($_SESSION[$this->key])) {
			foreach ($_SESSION[$this->key] as $id=>$item)
				if (!isset($key) ||
					array_key_exists($key,$item) && $item[$key]==$val ||
					$key=='_id' && $id==$val) {
					$obj=clone($this);
					$obj->id=$id;
					$obj->item=$item;
					$out[]=$obj;
				}
		}
		return $out;
	}
281469
public static function isStringInList(array $list, ?string $key = null): bool
    {
        $stringInList = false;
        if (count($list) === 0) {
            return $stringInList;
        }
        foreach ($list as $item) {
            if ($key !== null && isset($item[$key])) {
                $value = $item[$key];
            } else {
                $value = $item;
            }
            if (!is_numeric($value)) {
                $stringInList = true;
            }
        }
        return $stringInList;
    }