summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat/msgformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat/msgformat.c')
-rw-r--r--ext/intl/msgformat/msgformat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 15d6ef8321..2675aca5b8 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -26,7 +26,7 @@
#include "intl_convert.h"
/* {{{ */
-static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
+static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
{
const char* locale;
char* pattern;
@@ -35,11 +35,12 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
int spattern_len = 0;
zval* object;
MessageFormatter_object* mfo;
+ int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss",
+ if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "ss",
&locale, &locale_len, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@@ -96,7 +97,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
PHP_FUNCTION( msgfmt_create )
{
object_init_ex( return_value, MessageFormatter_ce_ptr );
- msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
RETURN_NULL();
}
@@ -112,7 +113,7 @@ PHP_METHOD( MessageFormatter, __construct )
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = getThis();
- msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
if (!EG(exception)) {
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);