Skip to content

Commit e4d6d0d

Browse files
cmb69David Ellingsworth
authored and
David Ellingsworth
committed
Fix phpGH-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 phpGH-15091.
1 parent b2b1ce8 commit e4d6d0d

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
@@ -24,6 +24,9 @@ PHP NEWS
2424
. Added SpoofChecker::setAllowedChars to set unicode chars ranges.
2525
(David Carlier)
2626

27+
- Intl:
28+
. Fixed bug GH-15087 (IntlChar::foldCase()'s $option is not optional). (cmb)
29+
2730
- Opcache:
2831
. Fixed bug GH-13775 (Memory leak possibly related to opcache SHM placement).
2932
(Arnaud)

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
@@ -401,8 +401,9 @@ IC_METHOD(foldCase) {
401401
zend_string *string_codepoint;
402402
zend_long int_codepoint = 0;
403403

404-
ZEND_PARSE_PARAMETERS_START(2, 2)
404+
ZEND_PARSE_PARAMETERS_START(1, 2)
405405
Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint)
406+
Z_PARAM_OPTIONAL
406407
Z_PARAM_LONG(options)
407408
ZEND_PARSE_PARAMETERS_END();
408409

0 commit comments

Comments
 (0)