]> granicus.if.org Git - php/commitdiff
Fixed bug #62976 (Notice: could not be converted to int when comparing some builtin...
authorXinchen Hui <laruence@php.net>
Fri, 31 Aug 2012 03:22:43 +0000 (11:22 +0800)
committerXinchen Hui <laruence@php.net>
Fri, 31 Aug 2012 03:22:43 +0000 (11:22 +0800)
NEWS
Zend/zend_operators.c
tests/lang/compare_objects_basic2.phpt

diff --git a/NEWS b/NEWS
index 2ef6084e99ef52d63678ce7569ec28900a21b0c4..a6e05be56856923efc19694c528a61992a836b04 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? ??? 2012, PHP 5.3.16
 
 - Core:
+  . Fixed bug #62976 (Notice: could not be converted to int when comparing
+    some builtin classes). (Laruence)
   . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
   . Fixed bug #62955 (Only one directive is loaded from "Per Directory Values" 
     Windows registry). (aserbulov at parallels dot com)
index e6fe67e7649ce3420e6febfb0d34de8b98c5fa54..aea63faeddc18d5c4d141d60718f49a655569e7c 100644 (file)
@@ -1489,6 +1489,9 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
                                                ret = compare_function(result, op1, op_free TSRMLS_CC);
                                                zend_free_obj_get_result(op_free TSRMLS_CC);
                                                return ret;
+                                       } else if (Z_TYPE_P(op1) == IS_OBJECT) {
+                                               ZVAL_LONG(result, 1);
+                                               return SUCCESS;
                                        }
                                }
                                if (!converted) {
index a2c34d06ad805b725624ca4055c3a8fc82bce6dd..7e4786cd289b57494bad0b7085b0be51bbb07cce 100644 (file)
@@ -20,9 +20,5 @@ var_dump($obj1 == $obj2);
 ===DONE===
 --EXPECTF--
 Simple test comparing two objects with different compare callback handler
-
-Notice: Object of class X could not be converted to int in %s on line %d
-
-Notice: Object of class DateTime could not be converted to int in %s on line %d
-bool(true)
-===DONE===
\ No newline at end of file
+bool(false)
+===DONE===