com php-src: Drop duplicate object-to-type notices: Zend/tests/call_with_refs.phpt Zend/zend_operators. c ext/openssl/tests/003.phpt
ext/standard/tests/gen eral_functions/type.phpt tests/classes/tostring_00 4.phpt

From: Date: Mon, 22 Jun 2015 14:25:32 +0000
Subject: com php-src: Drop duplicate object-to-type notices: Zend/tests/call_with_refs.phpt Zend/zend_operators. c ext/openssl/tests/003.phpt
ext/standard/tests/gen eral_functions/type.phpt tests/classes/tostring_00 4.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87449@lists.php.net to get a copy of this message
Commit: 8a83aed45847edf7e6ed59a996bc991dec3ef96b Author: Nikita Popov <nikic@php.net> Mon, 22 Jun 2015 16:24:11 +0200 Parents: d4cd659b5ab6032a7a3c7bbbd19d021f7ca47b0d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8a83aed45847edf7e6ed59a996bc991dec3ef96b Log: Drop duplicate object-to-type notices We already generate a recoverable fatal for these earlier, no need to throw an additional notice. Changed paths: M Zend/tests/call_with_refs.phpt M Zend/zend_operators.c M ext/openssl/tests/003.phpt M ext/standard/tests/general_functions/type.phpt M tests/classes/tostring_004.phpt Diff: diff --git a/Zend/tests/call_with_refs.phpt b/Zend/tests/call_with_refs.phpt index acad134..84c4edf 100644 --- a/Zend/tests/call_with_refs.phpt +++ b/Zend/tests/call_with_refs.phpt @@ -14,5 +14,4 @@ $data = call_user_func_array("substr_replace",array(&$my_var, new StdClass(),1)) echo "OK!"; --EXPECT-- Object of class stdClass could not be converted to string -Object of class stdClass to string conversion OK! diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 2658474..d9670a5 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -226,7 +226,7 @@ try_again: /* }}} */ -/* {{{ convert_object_to_type */ +/* {{{ convert_object_to_type: dst will be either ctype or UNDEF */ #define convert_object_to_type(op, dst, ctype, conv_func) \ ZVAL_UNDEF(dst); \ if (Z_OBJ_HT_P(op)->cast_object) { \ @@ -332,7 +332,6 @@ try_again: if (Z_TYPE(dst) == IS_LONG) { ZVAL_COPY_VALUE(op, &dst); } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name->val); ZVAL_LONG(op, 1); } @@ -393,8 +392,6 @@ try_again: if (Z_TYPE(dst) == IS_DOUBLE) { ZVAL_COPY_VALUE(op, &dst); } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to float", Z_OBJCE_P(op)->name->val); - ZVAL_DOUBLE(op, 1.0); } break; @@ -542,13 +539,11 @@ try_again: zval dst; convert_object_to_type(op, &dst, IS_STRING, convert_to_string); + zval_dtor(op); if (Z_TYPE(dst) == IS_STRING) { - zval_dtor(op); ZVAL_COPY_VALUE(op, &dst); } else { - zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name->val); - zval_dtor(op); ZVAL_NEW_STR(op, zend_string_init("Object", sizeof("Object")-1, 0)); } break; @@ -742,7 +737,6 @@ try_again: if (Z_TYPE(dst) == IS_LONG) { return Z_LVAL(dst); } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name->val); return 1; } } @@ -782,8 +776,6 @@ try_again: if (Z_TYPE(dst) == IS_DOUBLE) { return Z_DVAL(dst); } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name->val); - return 1.0; } } diff --git a/ext/openssl/tests/003.phpt b/ext/openssl/tests/003.phpt index 92c8c85..39363c4 100644 --- a/ext/openssl/tests/003.phpt +++ b/ext/openssl/tests/003.phpt @@ -27,7 +27,6 @@ echo "Done\n"; ?> --EXPECTF-- string(57) "Object of class stdClass could not be converted to string" -string(45) "Object of class stdClass to string conversion" string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert" bool(false) object(stdClass)#1 (0) { diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt index 74ba9e6..eb6f067 100644 --- a/ext/standard/tests/general_functions/type.phpt +++ b/ext/standard/tests/general_functions/type.phpt @@ -345,7 +345,6 @@ string(14) "Resource id #%d" bool(true) string(14) "Resource id #%d" string(57) "Object of class stdClass could not be converted to string" -string(45) "Object of class stdClass to string conversion" bool(true) string(6) "Object" Done diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt index de0283e..48e8668 100644 --- a/tests/classes/tostring_004.phpt +++ b/tests/classes/tostring_004.phpt @@ -38,7 +38,6 @@ printf($obj . "\n"); Object with no __toString(): Try 1: Error: 4096 - Object of class stdClass could not be converted to string -Error: 8 - Object of class stdClass to string conversion Object Try 2:

« previous php.cvs (#87449) next »