# Object equality

- Thread: https://externals.io/message/12978
- Original archive: https://news-web.php.net/php.internals/12978
- Started by Robert Silva on 2004-09-25T05:54:09+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12978 — Robert Silva — 2004-09-25T05:54:09+00:00

URL: https://externals.io/message/12978#12978

Hi Andi,

Based on your response to my question on how to compare object equality
properly. While looking through the code, in zend_operators.c in the
is_identical_function, when comparing objects, it uses the same construct I
came up with...

result->value.lval = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2));

Just an FYI, if comparing both object_handle and object_handlers are
required for checking true equality. A Z_OBJ_COMPARE_P macro sounds nice.

Bob Silva
