From: Andi Gutmans Date: Wed, 20 Oct 2004 17:57:28 +0000 (+0000) Subject: - If object handles are equal then save the comparison of properties in X-Git-Tag: PRE_NEW_VM_GEN_PATCH~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abd42847b12c205c31fa43d5d7c9e0a5b96b61c2;p=php - If object handles are equal then save the comparison of properties in - the == operator. --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 8a88ac9048..4fea659469 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1952,13 +1952,13 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) { result->type = IS_LONG; - if (Z_OBJ_HT_P(o1)->compare_objects == NULL) { - if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) { - result->value.lval = 0; - } else { - result->value.lval = 1; - } + if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) { + result->value.lval = 0; return; + } + + if (Z_OBJ_HT_P(o1)->compare_objects == NULL) { + result->value.lval = 1; } else { result->value.lval = Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC); }