summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-04-15 15:28:07 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-04-15 15:28:07 +0200
commitdaa78d7749c0b9fa6f622a94defc5e687e5727e0 (patch)
tree04fc728d3915ec44beca7bc2ad7373408fccf9ab
parent61a6a6ec51297506c54f3c6e60ace9b892d0a3e4 (diff)
parent2d7d5ab5c6484c6d3e16a8f15e5068ea0b0f566c (diff)
downloadphp-git-daa78d7749c0b9fa6f622a94defc5e687e5727e0.tar.gz
Merge branch 'PHP-7.4'
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp2
-rw-r--r--ext/intl/tests/bug77895.phpt13
2 files changed, 14 insertions, 1 deletions
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index fbff95743e..73d8d8c356 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -69,7 +69,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(ZEND_NUM_ARGS(), "sll|zzs",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ll|zzs",
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
return FAILURE;
diff --git a/ext/intl/tests/bug77895.phpt b/ext/intl/tests/bug77895.phpt
new file mode 100644
index 0000000000..18b4f778e6
--- /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--
+<?php
+
+declare(strict_types=1);
+
+var_dump(IntlDateFormatter::create(null, IntlDateFormatter::NONE, IntlDateFormatter::NONE));
+
+?>
+--EXPECT--
+object(IntlDateFormatter)#1 (0) {
+}