Check if value matches value from another field.

@param mixed  $value
@param string $field
@param bool   $strict

@return bool
961087
public function match($value, string $field, bool $strict = false): bool
    {
        if ($strict) {
            return $value === $this->getValidator()->getValue($field, null);
        }

        return $value == $this->getValidator()->getValue($field, null);
    }
924360
public function equals( $value, bool $strict = false ) : bool
   {

      if ( null === $value )
      {
         return false;
      }

      if ( $value instanceof MailAddress )
      {
         return
            ( $value->_userPart === $this->_userPart )
            &&
            ( ( (string) $value->_domainPart ) === ( (string) $this->_domainPart ) );
      }

      if ( $strict )
      {
         return false;
      }

      $val = null;

      if ( \is_string( $value ) )
      {
         if ( false !== ( $val = MailAddress::Parse( $value ) ) )
         {
            return
               ( $val->_userPart === $this->_userPart )
               &&
               ( ( (string) $val->_domainPart ) === ( (string) $this->_domainPart ) );
         }
         return false;
      }

      if ( $value instanceof Domain )
      {
         return ( ( (string) $value ) === ( (string) $this->_domainPart ) );
      }

      try
      {
         $typeInfo = new Type( $value );
         if ( ! $typeInfo->hasAssociatedString() )
         {
            return false;
         }
      }
      catch ( \Throwable $ex ) { unset ( $ex ); return false; }

      if ( false === ( $val = MailAddress::Parse( $typeInfo->getStringValue(), false, false, true ) ) )
      {
         return false;
      }

      return
         ( $val->_userPart === $this->_userPart )
         &&
         ( ( (string) $val->_domainPart ) === ( (string) $this->_domainPart ) );

   }
472673
public function compare($strict = false)
    {
        return CompareHelper::compare($this->compare1, $this->operator, $this->compare2, $strict);
    }
314551
public function matchValues(int $values, bool $strict = false)
    {
        while (count($this->values) < $values) {
            array_push($this->values, 0);
        }

        if ($strict) {
            $this->values = array_slice($this->values, 0, $values);
        }
    }
1051148
protected function validateRequired($field, $value)
    {
        if (is_null($value)) {
            return false;
        } elseif (is_string($value) && '' === trim($value)) {
            return false;
        }

        return true;
    }
485466
public function _validation_match_value($val, $compare, $strict = false)
	{
		// first try direct match
		if ($this->_empty($val) || $val === $compare || ( ! $strict && $val == $compare))
		{
			return true;
		}

		// allow multiple input for comparison
		if (is_array($compare))
		{
			foreach($compare as $c)
			{
				if ($val === $c || ( ! $strict && $val == $c))
				{
					return true;
				}
			}
		}

		// all is lost, return failure
		return false;
	}
761017
public function contains($value, bool $strict = false): bool
    {
        return (bool) in_array($this->storage, $value, $strict);
    }
718248
protected function validateContains($field, $value, $params)
    {
        if (!isset($params[0])) {
            return false;
        }
        if (!\is_string($value) || !\is_string($params[0])) {
            return false;
        }

        $strict = true;
        if (isset($params[1])) {
            $strict = (bool) $params[1];
        }

        if ($strict) {
            return \mb_strpos($value, $params[0]) !== false;
        }

        return \mb_stripos($value, $params[0]) !== false;
    }
377880
function keysOf ($value, $strict = true)
  {
    $this->A = array_keys ($this->A, $value, $strict);
    return $this;
  }
1066991
public static function json($val, $strict = true): bool
    {
        if (!$val || (!\is_string($val) && !\method_exists($val, '__toString'))) {
            return false;
        }

        $val = (string)$val;

        // must start with: { OR [
        if ($strict && '[' !== $val[0] && '{' !== $val[0]) {
            return false;
        }

        \json_decode($val);

        return \json_last_error() === \JSON_ERROR_NONE;
    }
38904
protected function confirmValidate($value, $field)
    {
        return isset($this->data[$field]) && $this->data[$field] === $value;
    }
935279
public static function toScalar($value, $strict = false)
    {
        if (is_scalar($value)) {
            return $value;
        }

        if (is_null($value)) {
            if (!$strict) {
                return $value;
            }
            throw new Exceptions\WrongParameterType(
                'Expected scalar or object with __toString method on strict mode, got ' . ValueDescriber::describe($value)
            );
        }

        return ToString::toString($value);
    }
1262405
public function by($field, $value)
    {
        $filtered = $this->filter(function($fieldset) use($field, $value) {
            if (isset($fieldset->{$field}) and $fieldset->{$field} == $value) {
                return true;
            }
            return false;
        });
        return $filtered->isEmpty() ? null : ($filtered->count() > 1 ? $filtered : $filtered->first());
    }
861765
public static function equals($value, $required, $strict = false)
    {
        return Validator::equals($value, $strict)->validate($required);
    }
1103350
protected function validateIn($field, $value, $params)
    {
        $isAssoc = \array_values($params[0]) !== $params[0];
        if ($isAssoc) {
            $params[0] = \array_keys($params[0]);
        }

        $strict = false;
        if (isset($params[1])) {
            $strict = $params[1];
        }

        return \in_array($value, $params[0], $strict);
    }
745524
public function search($value, bool $strict = false)
    {
        if (!$strict) {
            /** @var Collection $values */
            $values = $this->copy();
            $values->apply(function ($value) {
                if (is_string($value)) {
                    return strtolower($value);
                }

                return $value;
            });

            $value = strtolower($value);
        } else {
            $values = $this;
        }

        return array_search($value, $values->toArray(), $strict);
    }
271634
public function search($value, bool $strict = false)
    {
        return array_search($value, $this->storage, $strict);
    }