Browse Source

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()
pull/2588/head
Remi Collet 9 years ago
parent
commit
90f33b1ac7
  1. 2
      ext/intl/collator/collator_class.c
  2. 2
      ext/intl/php_intl.c
  3. 21
      ext/intl/tests/bug74705.phpt

2
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
};
/* }}} */

2
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 )

21
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===
Loading…
Cancel
Save