Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c
| From: | Antony Dovgal | Date: | Wed, 06 Jun 2007 21:12:47 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c | ||
| References: | 1 2 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-5839@lists.php.net to get a copy of this message | ||
On 07.06.2007 01:04, Marcus Boerger wrote:
Hello Antony, identical comparison means comparing both handle and handler pointer. Comparing only one is not enough.if (handler pointers are equal) { if (handles are equal) { ... return true; } ... return true; } What do I miss here?
-- Wbr, Antony Dovgalhttp://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.274&r2=1.275&diff_format=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.274 ZendEngine2/zend_operators.c:1.275 --- ZendEngine2/zend_operators.c:1.274 Mon May 21 07:34:41 2007+++ ZendEngine2/zend_operators.c Wed Jun 6 11:57:24 2007@@ -17,7 +17,7 @@+----------------------------------------------------------------------+*/ -/* $Id: zend_operators.c,v 1.274 2007/05/21 07:34:41 tony2001 Exp $ */ +/* $Id: zend_operators.c,v 1.275 2007/06/06 11:57:24 tony2001 Exp $ */ #include <ctype.h> @@ -1947,6 +1947,11 @@/* If both are objects sharing the same comparision handler then use is */ if (eq_comp) { + if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { + /* object handles are identical, apprently this is the same object */ + ZVAL_LONG(result, 0); + COMPARE_RETURN_AND_FREE(SUCCESS); + } ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); COMPARE_RETURN_AND_FREE(SUCCESS); }