summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-08-31 11:23:33 +0800
committerXinchen Hui <laruence@php.net>2012-08-31 11:24:10 +0800
commit66fad45724214c21491daa21031ac6e5a59d5e3a (patch)
tree63ad6cd5daf457067f8875bf0c8e76bb8406fbb5
parenteb8d603d464af6e50a0907cf4f47a6dc60bce4b5 (diff)
parent5dc2cef370885c552c20f3ff44bccd402850de9e (diff)
downloadphp-git-66fad45724214c21491daa21031ac6e5a59d5e3a.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
-rw-r--r--NEWS2
-rw-r--r--Zend/zend_operators.c3
-rw-r--r--tests/lang/compare_objects_basic2.phpt8
3 files changed, 7 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 99a30c81c9..97cb3d0fad 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP NEWS
?? ??? 2012, PHP 5.4.7
- 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 #62844 (parse_url() does not recognize //). (Andrew Faulds).
. Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index f9686251fe..9b01e5fbcb 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1519,6 +1519,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) {
diff --git a/tests/lang/compare_objects_basic2.phpt b/tests/lang/compare_objects_basic2.phpt
index a2c34d06ad..7e4786cd28 100644
--- a/tests/lang/compare_objects_basic2.phpt
+++ b/tests/lang/compare_objects_basic2.phpt
@@ -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===