summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-09-05 15:05:19 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-09-05 15:05:19 +0200
commitc0a389a9277070f5ef53c230f34aa5072a9f0985 (patch)
treeaf8f724f0176b324986fa79b995971b8dd2c6950 /ext/reflection/php_reflection.c
parent0f724453c03b7ff500563c019f5dab736d326ad8 (diff)
downloadphp-git-c0a389a9277070f5ef53c230f34aa5072a9f0985.tar.gz
Fix #74454: Wrong exception being thrown when using ReflectionMethod
If zend_throw_exception_ex() already threw an exception, we should not throw again.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 690aaa0fe6..bd2d824c38 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3130,8 +3130,10 @@ ZEND_METHOD(reflection_method, __construct)
switch (Z_TYPE_P(classname)) {
case IS_STRING:
if ((ce = zend_lookup_class(Z_STR_P(classname))) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0,
- "Class %s does not exist", Z_STRVAL_P(classname));
+ if (!EG(exception)) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
+ "Class %s does not exist", Z_STRVAL_P(classname));
+ }
if (classname == &ztmp) {
zval_dtor(&ztmp);
}