Match value against comparison input

@param   mixed
@param   mixed
@param   bool  whether to do type comparison
@return  bool
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;
	}
1229469
func (v Value) Bool() (bool, error) {
	b, err := strconv.ParseBool(v.String())
	if err != nil {
		return false, v.invalidTypeError(err, "bool")
	}
	return b, nil
}
390672
protected function get_bool_value(
		/** @noinspection PhpUnusedParameterInspection */
		$value, $default, $setting
	) {
		if ( is_bool( $value ) ) {
			return $value;
		}
		if ( 'true' === $value ) {
			return true;
		}
		if ( 'false' === $value ) {
			return false;
		}
		if ( isset( $value ) && (string) $value !== '' ) {
			return ! empty( $value );
		}

		return ! empty( $default );
	}
895988
public boolean matches(T other) {
    if (matchAny) {
      return true;
    } else if (other == null) {
      return negation ? value != null : value == null;
    } else {
      if (value instanceof byte[]) {
        boolean equal = Arrays.equals((byte[]) value, (byte[]) other);
        return negation ? !equal : equal;
      }
      return negation ? !Objects.equals(value, other) : Objects.equals(value, other);
    }
602385
function areThingsEqual (a, b) {
  var aKeys , bKeys , i;

  // Strings, booleans, numbers, null
  if (a === null || typeof a === 'string' || typeof a === 'boolean' || typeof a === 'number' ||
      b === null || typeof b === 'string' || typeof b === 'boolean' || typeof b === 'number') { return a === b; }

  // Dates
  if (util.isDate(a) || util.isDate(b)) { return util.isDate(a) && util.isDate(b) && a.getTime() === b.getTime(); }

  // Arrays (no match since arrays are used as a $in)
  // undefined (no match since they mean field doesn't exist and can't be serialized)
  if ((!(util.isArray(a) && util.isArray(b)) && (util.isArray(a) || util.isArray(b))) || a === undefined || b === undefined) { return false; }

  // General objects (check for deep equality)
  // a and b should be objects at this point
  try {
    aKeys = Object.keys(a);
    bKeys = Object.keys(b);
  } catch (e) {
    return false;
  }

  if (aKeys.length !== bKeys.length) { return false; }
  for (i = 0; i < aKeys.length; i += 1) {
    if (bKeys.indexOf(aKeys[i]) === -1) { return false; }
    if (!areThingsEqual(a[aKeys[i]], b[aKeys[i]])) { return false; }
  }
  return true;
}
513970
function _equals(a, b) {
    if (a === b) {
        return true;
    }

    const aType = $type(a);

    if (aType != $type(b)) {
        return false;
    }

    if (aType == 'array') {
        return _arrEquals(a, b);
    }

    if (aType == 'object') {
        return _objEquals(a, b);
    }

    if (aType == 'date') {
        return +a == +b;
    }

    return false;
}
219792
public boolean compareAndPut(V testValue, K key, V value)
  {
    V result = compareAndPut(testValue, key, value, true);

    return testValue == result;
  }
581634
private function validateBool(string $str) : bool
    {
        $ret = filter_var($str,FILTER_VALIDATE_BOOLEAN);
        if ($ret === null){
            throw new CompileErrorException('invalid boolean value', $this->state);
        }
        return $ret;
    }
1080016
public static boolean parseBoolean(String bool, boolean defaultInt) {
        if (bool == null) {
            return defaultInt;
        } else {
            return Boolean.parseBoolean(bool);
        }
    }
905820
public static function bool(&$value=false, bool $flatten=false) {
		// Short circuit.
		if (\is_bool($value)) {
			return;
		}

		if (! $flatten && \is_array($value)) {
			foreach ($value as $k=>$v) {
				static::bool($value[$k]);
			}
		}
		else {
			// Evaluate special cases.
			if (\is_string($value)) {
				$value = \strtolower($value);
				if (\in_array($value, constants::TRUE_BOOLS, true)) {
					$value = true;
				}
				elseif (\in_array($value, constants::FALSE_BOOLS, true)) {
					$value = false;
				}
			}
			elseif (\is_array($value)) {
				$value = !! \count($value);
			}

			if (! \is_bool($value)) {
				try {
					$value = (bool) $value;
				} catch (\Throwable $e) {
					$value = false;
				}
			}
		}
	}
223655
@Override
	public boolean matches(Object entity) {
		T t = property.get(entity);
		
		for (T value : values) {
			if (t.compareTo(value) == 0) {
				return true;
			}
		}
		
		return false;
	}
556984
public function is_bool($bValue)
    {
        $this->set_message('is_bool', lang('fv_is_bool_field'));
        return is_bool($bValue) || $bValue === '1' || $bValue === '0' || $bValue === 1 || $bValue === 0;
    }
728643
public function Compare( $other )
	{
		// BMS 2019-04-28
		// Probably need to do this for all other numeric types and the boolean
	    switch ( $other->GetValueCode() )
	    {
			case DecimalProxyFactory::Code:
				return 1;

	    	case StringProxyFactory::Code:
				return 0;

	        default:
	        	return -2;
	    }

		if ( $other->GetValueCode() == StringProxyFactory::Code )
	        return 0;
	    return -2;
	}
84082
public function is($key, $compareWith = true, $strictMode = false)
    {
        if (strpos($key, '.') === false) {
            $value = $this->get($key);
        } else {
            $value = $this->find($key);
        }

        if ($strictMode) {
            return $value === $compareWith;
        }

        /** @noinspection TypeUnsafeComparisonInspection */
        return $value == $compareWith;
    }
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 . '|');
    }
1155646
public function match($matchUrl = null)
    {
        if (null !== $matchUrl) {
            $this->setMatchUrl($matchUrl);
        }

        if ($this->isUrlEqual()) {
            return true;
        } else {
            return false;
        }

    }
513025
private static function boolval($value)
    {
        if (is_numeric($value)) {
            $value = (float) $value > 0;
        } elseif (is_string($value)) {
            $value = 'false' !== $value;
        }

        return is_bool($value) ? $value : false;
    }