summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-04-02 18:52:32 +0200
committerNikita Popov <nikic@php.net>2015-04-06 11:27:34 +0200
commit122d759618a42bff105971b923fbbb5be02e34b9 (patch)
treefd4487414ffa3f120c77b19b9eb7dc409659c57e /Zend/zend.c
parent884b0365dbe718f667d048dbc3d1cd9d9f12ab84 (diff)
downloadphp-git-122d759618a42bff105971b923fbbb5be02e34b9.tar.gz
Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to report FAILURE errors using a TypeException instead of a Warning, like it would happen in strict mode. Adds a zend_parse_parameters_throw() convenience function, which invokes zpp with this flag. Converts all cases I could identify, where we currently have throwing zpp usage in constructors and replaces them with this API. Error handling is still replaced to EH_THROW in some cases to handle other, domain-specific errors in constructors.
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 99e560ac03..a7d456876a 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1316,14 +1316,14 @@ ZEND_API void zend_type_error(const char *format, ...) /* {{{ */
va_end(va);
} /* }}} */
-ZEND_API void zend_internal_type_error(zend_bool strict, const char *format, ...) /* {{{ */
+ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
- if (strict) {
+ if (throw_exception) {
zend_throw_exception(zend_get_type_exception(), message, E_ERROR);
} else {
zend_error(E_WARNING, message);