@param self $comparison

@return bool
178442
public function overlap(DatePeriodDateTime $comparison) : bool
    {
        $start = $this;
        $end = $this->getEndDate();

        $comparisonStart = $comparison;
        $comparisonEnd = $comparison->getEndDate();

        /*
         *            L     H
         * C :        |_____|
         * 1 :      __|__   |
         * 2 :     ___|     |
         * 3 :        |   __|___
         * 4 :        |     |___
         * 5 :      __|_____|__
         * 6 :        |_____|___
         * 7 :      __|_____|
         * 8 :        |_____|
         * 9 :   __   |     |
         * 10:        |     | __
         * 11:        |  __ |
         */

        // case 1
        if ($start->lt($comparisonStart) && $comparisonStart->gt($start) && $end->lt($comparisonEnd) && $end->gt($comparisonStart)) {
            return true;
        }

        // case 2
        if ($end->eq($comparisonStart)) {
            return false;
        }

        // case 3
        if ($start->gt($comparisonStart) && $start->lt($comparisonEnd) && $end->gt($comparisonEnd)) {
            return true;
        }

        // case 4
        if ($start->eq($comparisonEnd)) {
            return false;
        }

        // case 5
        if ($start->lt($comparisonStart) && $end->gt($comparisonEnd)) {
            return true;
        }

        // case 6
        if ($start->eq($comparisonStart) && $end->gt($comparisonEnd)) {
            return true;
        }

        // case 7
        if ($start->lt($comparisonStart) && $end->eq($comparisonEnd)) {
            return true;
        }

        // case 8
        if ($start->eq($comparisonStart) && $end->eq($comparisonEnd)) {
            return true;
        }

        // case 11
        if ($start->gt($comparisonStart) && $end->lt($comparisonEnd)) {
            return true;
        }

        return false;
    }
1350523
public function walkComparison(Comparison $comparison)
    {
        $value    = $this->getValueFromComparison($comparison);
        $field    = $comparison->getField();
        $operator = $comparison->getOperator();

        if (($operator === Comparison::EQ || $operator === Comparison::IS) && $value === null) {
            return;
        } elseif ($operator === Comparison::NEQ && $value === null) {
            return;
        }

        $this->values[] = $value;
        $this->types[]  = [$field, $value, $operator];
    }
643285
public function compare(Type $left, Type $right)
    {
        return
            $right->accept(new TypeEquivalenceComparatorVisitor($this, $left));
    }
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;
    }
893651
public function compare($a, $b)
    {
        if ($this->collator instanceof \Collator) {
            return $this->collator->compare($a, $b);
        } else {
            return $a == $b ? 0 : ($a > $b ? 1 : -1);
        }
    }
1056336
public function equals( $fileName )
	{
		$toCompare	= FS_File_Reader::load( $fileName );
		$thisFile	= FS_File_Reader::load( $this->fileName );
		return( $thisFile == $toCompare );
	}
1080633
public function lt($other)
    {
        if (!($other instanceof self)) {
            $other = new BigInt($other);
        }
        return ($this->compare($other) < 0);
    }
575091
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if (!($other instanceof ExpressionNode)) {
            return false;
        }

        if ($this->getOperator() != $other->getOperator()) return false;

        $thisLeft = $this->getLeft();
        $otherLeft = $other->getLeft();
        $thisRight = $this->getRight();
        $otherRight = $other->getRight();

        if ($thisLeft === null) {
            return $otherLeft === null && $thisRight->compareTo($otherRight);
        }

        if ($thisRight === null) {
            return $otherRight=== null && $thisLeft->compareTo($otherLeft);
        }

        return $thisLeft->compareTo($otherLeft) && $thisRight->compareTo($otherRight);
    }
472673
public function compare($strict = false)
    {
        return CompareHelper::compare($this->compare1, $this->operator, $this->compare2, $strict);
    }
850889
public function compareTo($other): bool {
        if(!($other instanceof $this)) {
            return FALSE;
        }
        if($this->getFileName() !== $other->getFileName()) {
            return FALSE;
        }
        return TRUE;
    }
731432
public function setComparison($comparison)
    {
        if (!in_array($comparison, $this->getAvailableComparisons())) {
            throw new FieldException(sprintf('Comparison "%s" not allowed for this type of field ("%s").', $comparison, $this->getType()));
        }

        $this->comparison = $comparison;
    }
236764
protected function getValueFromComparison(Comparison $comparison)
    {
        $value = $comparison->getValue()->getValue();

        switch ($comparison->getOperator()) {
            case Comparison::CONTAINS:
                return '%' . $value . '%';
            case Comparison::STARTS_WITH:
                return $value . '%';
            case Comparison::ENDS_WITH:
                return '%' . $value;
            default:
                return $value;
        }
    }
152909
public function evaluate($value) {
		switch ($this->comparison) {
			case '':
			case '=':
				foreach ($this->value as $value_item) {
					if ($value_item == $value) {
						return true;
					}
				}
				return false;
			case '!=':
			case '<>':
				foreach ($this->value as $value_item) {
					if ($value_item != $value) {
						return true;
					}
				}
				return false;
			case '<':
				foreach ($this->value as $value_item) {
					if ($value_item < $value) {
						return true;
					}
				}
				return false;
			case '>':
				foreach ($this->value as $value_item) {
					if ($value_item > $value) {
						return true;
					}
				}
				return false;
			case '<=':
				foreach ($this->value as $value_item) {
					if ($value_item <= $value) {
						return true;
					}
				}
				return false;
			case '>=':
				foreach ($this->value as $value_item) {
					if ($value_item >= $value) {
						return true;
					}
				}
				return false;
			default:
				throw new \Exception("Unsupported comparison operator: '" . $this->comparison . "'");
		}
	}
596352
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if (!($other instanceof FunctionNode)) {
            return false;
        }

        $thisOperand = $this->getOperand();
        $otherOperand = $other->getOperand();

        return $this->getName() == $other->getName() && $thisOperand->compareTo($otherOperand);
    }
899746
public function walkComparison(Comparison $comparison) : Expr
    {
        switch ($comparison->getOperator()) {
            case Comparison::EQ:
            case Comparison::GT:
            case Comparison::GTE:
            case Comparison::IN:
            case Comparison::IS:
            case Comparison::LT:
            case Comparison::LTE:
            case Comparison::NEQ:
            case Comparison::NIN:
                $method = self::$operatorMethods[$comparison->getOperator()];

                return $this->builder->expr()
                    ->field($comparison->getField())
                    ->{$method}($this->walkValue($comparison->getValue()));

            case Comparison::CONTAINS:
                $value = $this->walkValue($comparison->getValue());

                return $this->builder->expr()
                    ->field($comparison->getField())
                    ->equals(new Regex($value, ''));

            default:
                throw new RuntimeException('Unknown comparison operator: ' . $comparison->getOperator());
        }
    }
1195762
public function equals($comparedValue, $identical = false)
    {
        $this->addCondition(__METHOD__, [$comparedValue, $identical]);

        return $this;
    }
437788
public static function compare($version)
    {
        $currentVersion = str_replace(' ', '', strtolower(self::VERSION));
        $version        = str_replace(' ', '', $version);

        return version_compare($version, $currentVersion);
    }