summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-06-18 00:30:16 +0200
committerAnatol Belski <ab@php.net>2015-06-18 00:30:16 +0200
commit577c1f3e955636ba0d88b79d6fa32ab3a01f1f0d (patch)
treeccc8de8802731714200c125db8f0b7fff363e1e0 /Zend/zend_exceptions.c
parent9076eb26c79c518ea5f10b29c4670cd655ae2f5f (diff)
downloadphp-git-577c1f3e955636ba0d88b79d6fa32ab3a01f1f0d.tar.gz
preserve the orig class name when extending the ErrorException
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 0d9506445e..d6d4fc735a 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -282,7 +282,14 @@ ZEND_METHOD(error_exception, __construct)
size_t message_len, filename_len;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, zend_ce_throwable) == FAILURE) {
- zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for ErrorException([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])");
+ zend_class_entry *ce;
+
+ if (execute_data->called_scope) {
+ ce = execute_data->called_scope;
+ } else {
+ ce = error_exception_ce;
+ }
+ zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])", ce->name->val);
return;
}