diff options
Diffstat (limited to 'ext/intl/formatter/formatter_main.c')
-rw-r--r-- | ext/intl/formatter/formatter_main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 5d5a139688..5b7e634053 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -25,7 +25,7 @@ #include "intl_convert.h" /* {{{ */ -static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) +static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) { const char* locale; char* pattern = NULL; @@ -33,10 +33,11 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) zend_long style; UChar* spattern = NULL; int32_t spattern_len = 0; + int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s", + if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "sl|s", &locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -78,7 +79,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) PHP_FUNCTION( numfmt_create ) { object_init_ex( return_value, NumberFormatter_ce_ptr ); - numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU); + numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) { RETURN_NULL(); } @@ -94,7 +95,7 @@ PHP_METHOD( NumberFormatter, __construct ) zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling); return_value = getThis(); - numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU); + numfmt_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); |