Skip to content

Commit f05d74f

Browse files
villfakrakjoe
authored andcommitted
Fixed bug #74433 Wrong reflection on the Normalizer methods
1 parent da41afe commit f05d74f

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ PHP NEWS
2121
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
2222
(krakjoe)
2323

24+
- intl:
25+
. Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
26+
2427
- MySQLnd:
2528
. Fixed bug #74376 (Invalid free of persistent results on error/connection
2629
loss). (Yussuf Khalil)

ext/intl/normalizer/normalizer_class.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ zend_class_entry *Normalizer_ce_ptr = NULL;
2929

3030
/* {{{ Normalizer methods arguments info */
3131

32-
ZEND_BEGIN_ARG_INFO_EX( normalizer_3_args, 0, 0, 3 )
33-
ZEND_ARG_INFO( 0, arg1 )
34-
ZEND_ARG_INFO( 0, arg2 )
35-
ZEND_ARG_INFO( 0, arg3 )
32+
ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
33+
ZEND_ARG_INFO( 0, input )
34+
ZEND_ARG_INFO( 0, form )
3635
ZEND_END_ARG_INFO()
3736

3837
/* }}} */
@@ -42,8 +41,8 @@ ZEND_END_ARG_INFO()
4241
*/
4342

4443
zend_function_entry Normalizer_class_functions[] = {
45-
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
46-
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
44+
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
45+
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
4746
PHP_FE_END
4847
};
4948
/* }}} */

ext/intl/tests/bug74433.phpt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #74433 Wrong reflection on the Normalizer methods
3+
--SKIPIF--
4+
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
5+
--FILE--
6+
<?php
7+
$rm = new ReflectionMethod(Normalizer::class, 'isNormalized');
8+
var_dump($rm->getNumberOfParameters());
9+
var_dump($rm->getNumberOfRequiredParameters());
10+
$rm = new ReflectionMethod(Normalizer::class, 'normalize');
11+
var_dump($rm->getNumberOfParameters());
12+
var_dump($rm->getNumberOfRequiredParameters());
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
int(2)
17+
int(1)
18+
int(2)
19+
int(1)
20+
===DONE===

0 commit comments

Comments
 (0)