From: Christoph M. Becker Date: Mon, 7 Sep 2015 21:46:12 +0000 (+0200) Subject: Fix #70454: IntlChar::forDigit second parameter should be optional X-Git-Tag: php-7.1.0alpha1~1220 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c902e2e630a6ed61983804994a4e312853008b4;p=php Fix #70454: IntlChar::forDigit second parameter should be optional ZPP expects "ll" instead of "l|l" what would match the "proto" and the ARG_INFO. --- diff --git a/ext/intl/uchar/tests/bug70454.phpt b/ext/intl/uchar/tests/bug70454.phpt new file mode 100644 index 0000000000..351bb65243 --- /dev/null +++ b/ext/intl/uchar/tests/bug70454.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #70454 (IntlChar::forDigit second parameter should be optional) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(48) +int(51) +int(51) +int(0) +int(97) diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c index 79eb8fda01..243da122a2 100644 --- a/ext/intl/uchar/uchar.c +++ b/ext/intl/uchar/uchar.c @@ -479,7 +479,7 @@ ZEND_END_ARG_INFO(); IC_METHOD(forDigit) { zend_long digit, radix = 10; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &digit, &radix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &digit, &radix) == FAILURE) { return; }