]> granicus.if.org Git - php/commitdiff
Fixed comparison od references
authorDmitry Stogov <dmitry@zend.com>
Mon, 24 Feb 2014 13:29:28 +0000 (17:29 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 24 Feb 2014 13:29:28 +0000 (17:29 +0400)
Zend/zend_operators.c

index 8504ca5aaf0b3d1ef1911d01b01d224435052c4f..7e77d976fba5228e56bd7b1d335a72fc9dd3b0d6 100644 (file)
@@ -1667,7 +1667,11 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
                                                return SUCCESS;
                                        }
                                }
-                               if (!converted) {
+                               if (Z_TYPE_P(op1) == IS_REFERENCE) {
+                                       op1 = Z_REFVAL_P(op1);
+                               } else if (Z_TYPE_P(op2) == IS_REFERENCE) {
+                                       op2 = Z_REFVAL_P(op2);
+                               } else if (!converted) {
                                        if (Z_TYPE_P(op1) == IS_NULL) {
                                                zendi_convert_to_boolean(op2, op2_copy, result);
                                                ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0);