Skip to content

Commit 5fbda73

Browse files
committed
Fix GH-15087 IntlChar::foldCase()'s $option is not optional
Since that parameter is supposed to be optional (and has been prior to PHP 8.0.0), we fix the implementation instead of the stub. Closes GH-15091.
1 parent d41e97a commit 5fbda73

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ PHP NEWS
1818
. Fixed bug GH-14286 (ffi enum type (when enum has no name) make memory
1919
leak). (nielsdos, dstogov)
2020

21+
- Intl:
22+
. Fixed bug GH-15087 (IntlChar::foldCase()'s $option is not optional). (cmb)
23+
2124
- Opcache:
2225
. Fixed bug GH-13817 (Segmentation fault for enabled observers after pass 4).
2326
(Bob)

ext/intl/uchar/tests/gh15087.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
GH-15087 (IntlChar::foldCase()'s $option is not optional)
3+
--EXTENSIONS--
4+
intl
5+
--FILE--
6+
<?php
7+
var_dump(IntlChar::foldCase('I'));
8+
?>
9+
--EXPECT--
10+
string(1) "i"

ext/intl/uchar/uchar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,9 @@ IC_METHOD(foldCase) {
392392
zend_string *string_codepoint;
393393
zend_long int_codepoint;
394394

395-
ZEND_PARSE_PARAMETERS_START(2, 2)
395+
ZEND_PARSE_PARAMETERS_START(1, 2)
396396
Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint)
397+
Z_PARAM_OPTIONAL
397398
Z_PARAM_LONG(options)
398399
ZEND_PARSE_PARAMETERS_END();
399400

0 commit comments

Comments
 (0)