How to properly compare values of two identical entities?
Assuming you have two entities $a and $b.

You can convert them to arrays and compare the two arrays.

// if the position matters
$is_equal = ($a-&gt;toArray() === $b-&gt;toArray())

// if the position doesn't matter
$is_equal = ($a-&gt;toArray() == $b-&gt;toArray())


Edit: I thought the OP was about discovering if two entities have identical data.
After reading the question again it seems that OP wants a way to mark what is the difference in data.