diff options
author | Nikita Popov <nikic@php.net> | 2015-04-02 18:52:32 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-04-06 11:27:34 +0200 |
commit | 122d759618a42bff105971b923fbbb5be02e34b9 (patch) | |
tree | fd4487414ffa3f120c77b19b9eb7dc409659c57e /Zend/zend_API.h | |
parent | 884b0365dbe718f667d048dbc3d1cd9d9f12ab84 (diff) | |
download | php-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_API.h')
-rw-r--r-- | Zend/zend_API.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 23ec35f00c..a09d634ee7 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -257,8 +257,10 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array); /* Parameter parsing API -- andrei */ #define ZEND_PARSE_PARAMS_QUIET (1<<1) +#define ZEND_PARSE_PARAMS_THROW (1<<2) ZEND_API int zend_parse_parameters(int num_args, const char *type_spec, ...); ZEND_API int zend_parse_parameters_ex(int flags, int num_args, const char *type_spec, ...); +ZEND_API int zend_parse_parameters_throw(int num_args, const char *type_spec, ...); ZEND_API char *zend_zval_type_name(const zval *arg); ZEND_API int zend_parse_method_parameters(int num_args, zval *this_ptr, const char *type_spec, ...); |