diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 9268b9ddf5d..8c2b72a2daa 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -70,7 +70,7 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) intl_error_reset(NULL); object = return_value; /* Parse parameters. */ - if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs", + if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "s!ll|zzs", &locale_str, &locale_len, &date_type, &time_type, &timezone_zv, &calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: " diff --git a/ext/intl/tests/bug77895.phpt b/ext/intl/tests/bug77895.phpt new file mode 100644 index 00000000000..18b4f778e60 --- /dev/null +++ b/ext/intl/tests/bug77895.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #77895: IntlDateFormatter::create fails in strict mode if $locale = null +--FILE-- + +--EXPECT-- +object(IntlDateFormatter)#1 (0) { +}