Checks if right hand side has the same class and value as this
@param Enum $rhs
@return bool
427803
public function Equals(Enum $rhs = null)
    {
        return $rhs != null && 
            get_class($rhs) == get_class($this) &&
            $rhs->Value() === $this->Value();
    }
561339
protected function valueEquals($left, $right)
    {
        if ($left instanceof EqualityComparable) {
            return $left->isEqualTo($right, $this);
        } elseif ($right instanceof EqualityComparable) {
            return $right->isEqualTo($left, $this);
        }

        switch (gettype($left)) {
            case 'array':
                return $this->arrayEquals($left, $right);
            case 'object':
                return $this->objectEquals($left, $right);
        }

        return $left === $right;
    }
713707
public static function areEqual(&$ref1, &$ref2) : bool
    {
        if ($ref1 !== $ref2) {
            return false;
        }

        if (!self::$secret) {
            self::$secret = new \stdClass();
        }

        $tempStorage = $ref1;

        $ref1     = self::$secret;
        $areEqual = $ref1 === $ref2;

        $ref1 = $tempStorage;

        return $areEqual;
    }
62324
public function has_right($right)
    {
        $this->load_global_rights();

        if (!isset($this->_global_rights[$right])) {
            throw new Exception('This right does not exists');
        }

        return $this->_global_rights[$right];
    }
458590
public function equals(Result $result): bool
    {
        if (null !== $this->score xor null !== $result->score) {
            return false;
        }

        if (null !== $this->score && !$this->score->equals($result->score)) {
            return false;
        }

        if ($this->success !== $result->success) {
            return false;
        }

        if ($this->completion !== $result->completion) {
            return false;
        }

        if ($this->response !== $result->response) {
            return false;
        }

        if ($this->duration !== $result->duration) {
            return false;
        }

        if (null !== $this->extensions xor null !== $result->extensions) {
            return false;
        }

        if (null !== $this->extensions && null !== $result->extensions && !$this->extensions->equals($result->extensions)) {
            return false;
        }

        return true;
    }
464518
static function IsAfter(LogItem $lhs = null, LogItem $rhs = null)
    {
        if (!$lhs)
        {
            return false;
        }
        if (!$rhs)
        {
            return true;
        }
        return $lhs->GetChanged()->IsAfter($rhs->GetChanged());
    }
643285
public function compare(Type $left, Type $right)
    {
        return
            $right->accept(new TypeEquivalenceComparatorVisitor($this, $left));
    }
345407
public static StringExpression right(Expression<String> lhs, int rhs) {
        return right(lhs, ConstantImpl.create(rhs));
    }
975544
public static function has($value)
    {
        if ($value instanceof static && get_class($value) === get_called_class()) {
            return true;
        }
        $class = get_called_class();
        $constants = static::detectConstants($class);
        return in_array($value, $constants, true);
    }
120492
protected function objectEquals($left, $right)
    {
        if (!is_object($right)) {
            return false;
        }
        if (get_class($left) !== get_class($right)) {
            return false;
        }

        $stackKey = $this->objectComparisonStackKey($left, $right);
        if (array_key_exists($stackKey, $this->objectComparisonStack)) {
            return true;
        }
        $this->objectComparisonStack[$stackKey] = true;

        return $this->arrayEquals(
            $this->objectProperties($left),
            $this->objectProperties($right)
        );
    }
35708
public function equals($compare)
    {
        if ($compare instanceof self) {
            return ($compare->className === $this->className && $compare->methodName === $this->methodName);
        }
        
        return false;
    }
831200
public function sameValueAs(ValueObjectInterface $name)
    {
        if (false === Util::classEquals($this, $name)) {
            return false;
        }

        return $this->getFullName() == $name->getFullName();
    }
185926
private function whenMatch(Enum $enum, Match $match)
    {
        if (!$enum instanceof $this->subject) {
            $classSubject  = get_class($this->subject);
            $classArgument = get_class($enum);

            throw new InvalidArgumentException(
                "This map is already mapping an instance of {$classSubject}, " .
                "yet this invocation is trying to map an instance of {$classArgument}."
            );
        }

        if (array_key_exists($enum->getName(), $this->matches)) {
            throw new InvalidArgumentException(
                "This map has already mapped instance {$enum} to a value."
            );
        }

        /** @noinspection PhpInternalEntityUsedInspection */
        $this->matches[$enum->getName()] = $match;

        return $this;
    }
770006
public function isEqual()
    {
        // CHECK IMAGES DIMENSIONS
        if(!$this->isDimensionsEqual())
        {
            return FALSE;
        }

        $compare = $this->image1->compareImages($this->image2, Imagick::METRIC_MEANSQUAREERROR);

        // IMAGE IS EXACTLY THE SAME
        if($compare === TRUE)
        {
            return TRUE;
        }
        // IMAGE IS IN TOLERABLE RANGE
        elseif($compare)
        {
            if($compare[1] < $this->tolerance)
            {
                return TRUE;
            }
        }

        return FALSE;
    }
206944
public function equals($crit)
    {
        if (null === $crit || !($crit instanceof Criteria)) {
            return false;
        }

        /** @var Criteria $crit */
        if ($this === $crit) {
            return true;
        }

        if ($this->size() === $crit->size()) {

            // Important: nested criterion objects are checked

            $criteria = $crit; // alias
            if  ($this->offset            === $criteria->getOffset()
                && $this->limit           === $criteria->getLimit()
                && $this->ignoreCase      === $criteria->isIgnoreCase()
                && $this->singleRecord    === $criteria->isSingleRecord()
                && $this->dbName          === $criteria->getDbName()
                && $this->selectModifiers === $criteria->getSelectModifiers()
                && $this->selectColumns   === $criteria->getSelectColumns()
                && $this->asColumns       === $criteria->getAsColumns()
                && $this->orderByColumns  === $criteria->getOrderByColumns()
                && $this->groupByColumns  === $criteria->getGroupByColumns()
                && $this->aliases         === $criteria->getAliases()
               ) // what about having ??
            {
                foreach ($criteria->keys() as $key) {
                    if ($this->containsKey($key)) {
                        $a = $this->getCriterion($key);
                        $b = $criteria->getCriterion($key);
                        if (!$a->equals($b)) {
                            return false;
                        }
                    } else {
                        return false;
                    }
                }

                $joins = $criteria->getJoins();
                if (count($joins) != count($this->joins)) {
                    return false;
                }

                foreach ($joins as $key => $join) {
                    if (!$join->equals($this->joins[$key])) {
                        return false;
                    }
                }

                return true;
            } else {
                return false;
            }
        }

        return false;
    }
862154
private function keysAreEqual($a, $b): bool
    {
        if (is_object($a) && $a instanceof Hashable) {
            return get_class($a) === get_class($b) && $a->equals($b);
        }

        return $a === $b;
    }
39482
public static function isEqual($a, $b)
    {
        if ($a === $b) {
            return true;
        } elseif ($a instanceof \stdClass) {
            return self::isEqual((array) $a, $b);
        } elseif ($b instanceof \stdClass) {
            return self::isEqual($a, (array) $b);
        } else {
            return false;
        }
    }