1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00

Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey()

https://secure.php.net/manual/en/collator.getsortkey.php
This commit is contained in:
Tyson Andre
2017-06-07 21:32:57 -07:00
committed by Remi Collet
parent aea8c6ddc1
commit 5f07a895cc
2 changed files with 23 additions and 1 deletions

View File

@@ -119,7 +119,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
};
/* }}} */

View File

@@ -0,0 +1,22 @@
--TEST--
Bug #74705 Wrong reflection on Collator::getSortKey
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
--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===