diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2015-07-07 12:10:22 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2015-07-07 12:10:55 -0500 |
commit | 5df893ce3c6630fc77337ab0d78097eab1002bc1 (patch) | |
tree | 999340047c771e7ba4a6a17677330016bd803162 /Zend/zend_API.c | |
parent | 29c3cd44485fb8e43b29c46b1f9451e99bca92c8 (diff) | |
download | php-git-5df893ce3c6630fc77337ab0d78097eab1002bc1.tar.gz |
Use NULL where possible for exception class
Matches usage of zend_throw_exception()/zend_throw_exception_ex().
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 8b57457af2..c84ab13792 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1276,11 +1276,11 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type { if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) { if (class_type->ce_flags & ZEND_ACC_INTERFACE) { - zend_throw_error(zend_ce_error, "Cannot instantiate interface %s", ZSTR_VAL(class_type->name)); + zend_throw_error(NULL, "Cannot instantiate interface %s", ZSTR_VAL(class_type->name)); } else if (class_type->ce_flags & ZEND_ACC_TRAIT) { - zend_throw_error(zend_ce_error, "Cannot instantiate trait %s", ZSTR_VAL(class_type->name)); + zend_throw_error(NULL, "Cannot instantiate trait %s", ZSTR_VAL(class_type->name)); } else { - zend_throw_error(zend_ce_error, "Cannot instantiate abstract class %s", ZSTR_VAL(class_type->name)); + zend_throw_error(NULL, "Cannot instantiate abstract class %s", ZSTR_VAL(class_type->name)); } ZVAL_NULL(arg); Z_OBJ_P(arg) = NULL; @@ -3107,7 +3107,7 @@ get_function_via_handler: zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); retval = 0; } else { - zend_throw_error(zend_ce_error, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); + zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); return 0; } } else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { @@ -3131,7 +3131,7 @@ get_function_via_handler: } } else if (retval) { if (severity == E_ERROR) { - zend_throw_error(zend_ce_error, "Non-static method %s::%s() %s be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name), verb); + zend_throw_error(NULL, "Non-static method %s::%s() %s be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name), verb); } else { zend_error(severity, "Non-static method %s::%s() %s be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name), verb); } |