com php-src: Fixed bug #70548 (Redundant information printed in case of uncaught engine exception): NEWS Zend/tests/return_types/0 28.phpt
Zend/tests/typehints/scalar_return_basic_ 64bit.phpt Zend/zend_execute.c
| From: | Xinchen Hui | Date: | Wed, 23 Sep 2015 05:04:33 +0000 |
| Subject: | com php-src: Fixed bug #70548 (Redundant information printed in case of uncaught engine exception): NEWS Zend/tests/return_types/0 28.phpt Zend/tests/typehints/scalar_return_basic_ 64bit.phpt Zend/zend_execute.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89125@lists.php.net to get a copy of this message | ||
Commit: 504cd492e1b5c29abba7712438bf34934ee96c57
Author: Xinchen Hui <laruence@gmail.com> Wed, 23 Sep 2015 13:04:33 +0800
Parents: a9636ff5a254e0e054b55d328d6e370f34d71b0a
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=504cd492e1b5c29abba7712438bf34934ee96c57
Log:
Fixed bug #70548 (Redundant information printed in case of uncaught engine exception)
Bugs:
https://bugs.php.net/70548
Changed paths:
M NEWS
M Zend/tests/return_types/028.phpt
M Zend/tests/typehints/scalar_return_basic_64bit.phpt
M Zend/zend_execute.c
Diff:
diff --git a/NEWS b/NEWS
index 3bea485..ebb26cd 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ PHP NEWS
- Core:
. Fixed bug #70555 (fun_get_arg() on unsetted vars return UNKNOW). (Laruence)
+ . Fixed bug #70548 (Redundant information printed in case of uncaught engine
+ exception). (Laruence)
. Fixed bug #70547 (unsetting function variables corrupts backtrace).
(Laruence)
. Fixed bug #70528 (assert() with instanceof adds apostrophes around class
diff --git a/Zend/tests/return_types/028.phpt b/Zend/tests/return_types/028.phpt
index d2a78ed..8ded158 100644
--- a/Zend/tests/return_types/028.phpt
+++ b/Zend/tests/return_types/028.phpt
@@ -12,7 +12,7 @@ function foo(): stdClass {
try {
foo();
} catch (Error $e) {
- print $e->getMessage();
+ echo $e->getMessage(), " in ", $e->getFile(), " on line ",
$e->getLine();
}
?>
diff --git a/Zend/tests/typehints/scalar_return_basic_64bit.phpt
b/Zend/tests/typehints/scalar_return_basic_64bit.phpt
index 6994817..fc7401e 100644
--- a/Zend/tests/typehints/scalar_return_basic_64bit.phpt
+++ b/Zend/tests/typehints/scalar_return_basic_64bit.phpt
@@ -55,7 +55,7 @@ foreach ($functions as $type => $function) {
try {
var_dump($function($value));
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo "*** Caught ", $e->getMessage(), " in ", $e->getFile(),
" on line ", $e->getLine(), PHP_EOL;
}
}
}
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 67a6bc2..10b1473 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -926,14 +926,8 @@ static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const
ch
fclass = "";
}
- if (zf->common.type == ZEND_USER_FUNCTION) {
- zend_type_error("Return value of %s%s%s() must %s%s, %s%s returned in %s on line %d",
- fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind,
- ZSTR_VAL(zf->op_array.filename), EG(current_execute_data)->opline->lineno);
- } else {
- zend_type_error("Return value of %s%s%s() must %s%s, %s%s returned",
- fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
- }
+ zend_type_error("Return value of %s%s%s() must %s%s, %s%s returned",
+ fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
}
static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const char
*need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)