diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-07-05 02:08:39 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-07-05 02:08:39 -0500 |
commit | 24237027bc7e4f7aed9287fe9815c0577eeb1c22 (patch) | |
tree | bc23b05ba89a75f0e0711933371f708b96e63345 /ext/reflection/php_reflection.c | |
parent | 42666da1714673d537356221e688f57f404fe1d2 (diff) | |
parent | e9832b5ab1d986ddd3ea0705bcbc5a391dc16614 (diff) | |
download | php-git-24237027bc7e4f7aed9287fe9815c0577eeb1c22.tar.gz |
Merge branch 'throw-error-in-extensions'
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 6471e4aa2a..ebc34e902d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -107,7 +107,8 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection) intern = Z_REFLECTION_P(getThis()); \ if (intern->ptr == NULL) { \ RETURN_ON_EXCEPTION \ - php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \ + zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \ + return; \ } \ #define GET_REFLECTION_OBJECT_PTR(target) \ @@ -1496,7 +1497,8 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { return NULL; } - php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object"); + zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); + return NULL; } param = intern->ptr; @@ -5186,8 +5188,8 @@ ZEND_METHOD(reflection_class, isSubclassOf) if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr)) { argument = Z_REFLECTION_P(class_name); if (argument->ptr == NULL) { - php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object"); - /* Bails out */ + zend_throw_error(NULL, "Internal error: Failed to retrieve the argument's reflection object"); + return; } class_ce = argument->ptr; break; @@ -5230,8 +5232,8 @@ ZEND_METHOD(reflection_class, implementsInterface) if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr)) { argument = Z_REFLECTION_P(interface); if (argument->ptr == NULL) { - php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object"); - /* Bails out */ + zend_throw_error(NULL, "Internal error: Failed to retrieve the argument's reflection object"); + return; } interface_ce = argument->ptr; break; @@ -5631,8 +5633,8 @@ ZEND_METHOD(reflection_property, getValue) return; } if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) { - php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name)); - /* Bails out */ + zend_throw_error(NULL, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name)); + return; } member_p = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]; ZVAL_DEREF(member_p); @@ -5698,8 +5700,8 @@ ZEND_METHOD(reflection_property, setValue) } if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) { - php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name)); - /* Bails out */ + zend_throw_error(NULL, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name)); + return; } variable_ptr = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]; if (variable_ptr != value) { |