summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2017-06-13 08:50:10 +0200
committerRemi Collet <remi@php.net>2017-06-13 08:50:10 +0200
commit90f33b1ac733771f0e6b7480efa96879f5f488e9 (patch)
tree0e927d9a2cf139d2f2d9971edcd80f8c4aaaab47 /ext
parent593d37376b272f990a3007957a037b57e570216e (diff)
parentc4d7cfa53631dcfb5e4dd3b736324ad3d15f2f59 (diff)
downloadphp-git-90f33b1ac733771f0e6b7480efa96879f5f488e9.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: NEWS Fix bug #74705 for collator_get_sort_key Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey()
Diffstat (limited to 'ext')
-rw-r--r--ext/intl/collator/collator_class.c2
-rw-r--r--ext/intl/php_intl.c2
-rw-r--r--ext/intl/tests/bug74705.phpt21
3 files changed, 23 insertions, 2 deletions
diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c
index 23b03b52fb..d77a3432b8 100644
--- a/ext/intl/collator/collator_class.c
+++ b/ext/intl/collator/collator_class.c
@@ -112,7 +112,7 @@ zend_function_entry Collator_class_functions[] = {
PHP_NAMED_FE( getLocale, ZEND_FN( collator_get_locale ), collator_1_arg )
PHP_NAMED_FE( getErrorCode, ZEND_FN( collator_get_error_code ), collator_0_args )
PHP_NAMED_FE( getErrorMessage, ZEND_FN( collator_get_error_message ), collator_0_args )
- PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_2_args )
+ PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_1_arg )
PHP_FE_END
};
/* }}} */
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 69e62ca301..dc364678ac 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -639,7 +639,7 @@ zend_function_entry intl_functions[] = {
PHP_FE( collator_get_locale, collator_1_arg )
PHP_FE( collator_get_error_code, collator_0_args )
PHP_FE( collator_get_error_message, collator_0_args )
- PHP_FE( collator_get_sort_key, collator_2_args )
+ PHP_FE( collator_get_sort_key, collator_1_arg )
/* formatter functions */
PHP_FE( numfmt_create, arginfo_numfmt_create )
diff --git a/ext/intl/tests/bug74705.phpt b/ext/intl/tests/bug74705.phpt
new file mode 100644
index 0000000000..63a85845a0
--- /dev/null
+++ b/ext/intl/tests/bug74705.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #74705 Wrong reflection on Collator::getSortKey
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+$rm = new ReflectionMethod(Collator::class, 'getSortKey');
+var_dump($rm->getNumberOfParameters());
+var_dump($rm->getNumberOfRequiredParameters());
+
+$rf = new ReflectionFunction('collator_get_sort_key');
+var_dump($rf->getNumberOfParameters());
+var_dump($rf->getNumberOfRequiredParameters());
+?>
+===DONE===
+--EXPECT--
+int(1)
+int(1)
+int(2)
+int(2)
+===DONE===