src/Entity/Entity.php
private function areFieldValuesSame($value_1, $value_2)
    {
        if (($value_1 instanceof DateValueInterface && $value_2 instanceof DateValueInterface) || ($value_1 instanceof DateTimeValueInterface && $value_2 instanceof DateTimeValueInterface)) {
            return $value_1->getTimestamp() == $value_2->getTimestamp();
        } else {
            return $value_1 === $value_2;
        }
    }
private function areFieldValuesSame($value_1, $value_2)
    {
        if (($value_1 instanceof DateValueInterface && $value_2 instanceof DateValueInterface) || ($value_1 instanceof DateTimeValueInterface && $value_2 instanceof DateTimeValueInterface)) {
            return $value_1->getTimestamp() == $value_2->getTimestamp();
        } else {
            return $value_1 === $value_2;
        }
    }
Return true if field values match.

@param  mixed $value_1
@param  mixed $value_2
@return bool