Skip to content

Commit 2519827

Browse files
committed
Update gmp+bcmath parameter names
Closes GH-6205.
1 parent a88107d commit 2519827

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+220
-226
lines changed

ext/bcmath/bcmath.stub.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
/** @generate-function-entries */
44

5-
function bcadd(string $left_operand, string $right_operand, ?int $scale = null): string {}
5+
function bcadd(string $num1, string $num2, ?int $scale = null): string {}
66

7-
function bcsub(string $left_operand, string $right_operand, ?int $scale = null): string {}
7+
function bcsub(string $num1, string $num2, ?int $scale = null): string {}
88

9-
function bcmul(string $left_operand, string $right_operand, ?int $scale = null): string {}
9+
function bcmul(string $num1, string $num2, ?int $scale = null): string {}
1010

11-
function bcdiv(string $dividend, string $divisor, ?int $scale = null): string {}
11+
function bcdiv(string $num1, string $num2, ?int $scale = null): string {}
1212

13-
function bcmod(string $dividend, string $divisor, ?int $scale = null): string {}
13+
function bcmod(string $num1, string $num2, ?int $scale = null): string {}
1414

15-
function bcpowmod(string $base, string $exponent, string $modulus, ?int $scale = null): string {}
15+
function bcpowmod(string $num, string $exponent, string $modulus, ?int $scale = null): string {}
1616

17-
function bcpow(string $base, string $exponent, ?int $scale = null): string {}
17+
function bcpow(string $num, string $exponent, ?int $scale = null): string {}
1818

19-
function bcsqrt(string $operand, ?int $scale = null): string {}
19+
function bcsqrt(string $num, ?int $scale = null): string {}
2020

21-
function bccomp(string $left_operand, string $right_operand, ?int $scale = null): int {}
21+
function bccomp(string $num1, string $num2, ?int $scale = null): int {}
2222

2323
function bcscale(?int $scale = null): int {}

ext/bcmath/bcmath_arginfo.h

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: a1e223f29a06a2292a88c0e90e104cb956f80500 */
2+
* Stub hash: 0c1e2a6163a5fc0f42bf79bbc530af7c5fd77074 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcadd, 0, 2, IS_STRING, 0)
5-
ZEND_ARG_TYPE_INFO(0, left_operand, IS_STRING, 0)
6-
ZEND_ARG_TYPE_INFO(0, right_operand, IS_STRING, 0)
5+
ZEND_ARG_TYPE_INFO(0, num1, IS_STRING, 0)
6+
ZEND_ARG_TYPE_INFO(0, num2, IS_STRING, 0)
77
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null")
88
ZEND_END_ARG_INFO()
99

1010
#define arginfo_bcsub arginfo_bcadd
1111

1212
#define arginfo_bcmul arginfo_bcadd
1313

14-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcdiv, 0, 2, IS_STRING, 0)
15-
ZEND_ARG_TYPE_INFO(0, dividend, IS_STRING, 0)
16-
ZEND_ARG_TYPE_INFO(0, divisor, IS_STRING, 0)
17-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null")
18-
ZEND_END_ARG_INFO()
14+
#define arginfo_bcdiv arginfo_bcadd
1915

20-
#define arginfo_bcmod arginfo_bcdiv
16+
#define arginfo_bcmod arginfo_bcadd
2117

2218
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcpowmod, 0, 3, IS_STRING, 0)
23-
ZEND_ARG_TYPE_INFO(0, base, IS_STRING, 0)
19+
ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0)
2420
ZEND_ARG_TYPE_INFO(0, exponent, IS_STRING, 0)
2521
ZEND_ARG_TYPE_INFO(0, modulus, IS_STRING, 0)
2622
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null")
2723
ZEND_END_ARG_INFO()
2824

2925
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcpow, 0, 2, IS_STRING, 0)
30-
ZEND_ARG_TYPE_INFO(0, base, IS_STRING, 0)
26+
ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0)
3127
ZEND_ARG_TYPE_INFO(0, exponent, IS_STRING, 0)
3228
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null")
3329
ZEND_END_ARG_INFO()
3430

3531
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcsqrt, 0, 1, IS_STRING, 0)
36-
ZEND_ARG_TYPE_INFO(0, operand, IS_STRING, 0)
32+
ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0)
3733
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null")
3834
ZEND_END_ARG_INFO()
3935

4036
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bccomp, 0, 2, IS_LONG, 0)
41-
ZEND_ARG_TYPE_INFO(0, left_operand, IS_STRING, 0)
42-
ZEND_ARG_TYPE_INFO(0, right_operand, IS_STRING, 0)
37+
ZEND_ARG_TYPE_INFO(0, num1, IS_STRING, 0)
38+
ZEND_ARG_TYPE_INFO(0, num2, IS_STRING, 0)
4339
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null")
4440
ZEND_END_ARG_INFO()
4541

ext/bcmath/tests/bcsqrt_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414
}
1515
?>
1616
--EXPECT--
17-
bcsqrt(): Argument #1 ($operand) must be greater than or equal to 0
17+
bcsqrt(): Argument #1 ($num) must be greater than or equal to 0

ext/bcmath/tests/bug75178.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ try {
1818
}
1919
?>
2020
--EXPECT--
21-
bcpowmod(): Argument #1 ($base) cannot have a fractional part
21+
bcpowmod(): Argument #1 ($num) cannot have a fractional part
2222
bcpowmod(): Argument #3 ($modulus) cannot have a fractional part

ext/gmp/gmp.stub.php

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,105 +6,105 @@ class GMP
66
{
77
}
88

9-
function gmp_init(int|string $number, int $base = 0): GMP {}
9+
function gmp_init(int|string $num, int $base = 0): GMP {}
1010

11-
function gmp_import(string $data, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): GMP {}
11+
function gmp_import(string $data, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): GMP {}
1212

13-
function gmp_export(GMP|int|string $gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {}
13+
function gmp_export(GMP|int|string $num, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {}
1414

15-
function gmp_intval(GMP|int|string $gmpnumber): int {}
15+
function gmp_intval(GMP|int|string $num): int {}
1616

17-
function gmp_strval(GMP|int|string $gmpnumber, int $base = 10): string {}
17+
function gmp_strval(GMP|int|string $num, int $base = 10): string {}
1818

19-
function gmp_add(GMP|int|string $a, GMP|int|string $b): GMP {}
19+
function gmp_add(GMP|int|string $num1, GMP|int|string $num2): GMP {}
2020

21-
function gmp_sub(GMP|int|string $a, GMP|int|string $b): GMP {}
21+
function gmp_sub(GMP|int|string $num1, GMP|int|string $num2): GMP {}
2222

23-
function gmp_mul(GMP|int|string $a, GMP|int|string $b): GMP {}
23+
function gmp_mul(GMP|int|string $num1, GMP|int|string $num2): GMP {}
2424

25-
function gmp_div_qr(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): array {}
25+
function gmp_div_qr(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): array {}
2626

27-
function gmp_div_q(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {}
27+
function gmp_div_q(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
2828

29-
function gmp_div_r(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {}
29+
function gmp_div_r(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
3030

3131
/** @alias gmp_div_q */
32-
function gmp_div(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {}
32+
function gmp_div(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
3333

34-
function gmp_mod(GMP|int|string $a, GMP|int|string $b): GMP {}
34+
function gmp_mod(GMP|int|string $num1, GMP|int|string $num2): GMP {}
3535

36-
function gmp_divexact(GMP|int|string $a, GMP|int|string $b): GMP {}
36+
function gmp_divexact(GMP|int|string $num1, GMP|int|string $num2): GMP {}
3737

38-
function gmp_neg(GMP|int|string $a): GMP {}
38+
function gmp_neg(GMP|int|string $num): GMP {}
3939

40-
function gmp_abs(GMP|int|string $a): GMP {}
40+
function gmp_abs(GMP|int|string $num): GMP {}
4141

42-
function gmp_fact(GMP|int|string $a): GMP {}
42+
function gmp_fact(GMP|int|string $num): GMP {}
4343

44-
function gmp_sqrt(GMP|int|string $a): GMP {}
44+
function gmp_sqrt(GMP|int|string $num): GMP {}
4545

46-
function gmp_sqrtrem(GMP|int|string $a): array {}
46+
function gmp_sqrtrem(GMP|int|string $num): array {}
4747

48-
function gmp_root(GMP|int|string $a, int $nth): GMP {}
48+
function gmp_root(GMP|int|string $num, int $nth): GMP {}
4949

50-
function gmp_rootrem(GMP|int|string $a, int $nth): array {}
50+
function gmp_rootrem(GMP|int|string $num, int $nth): array {}
5151

52-
function gmp_pow(GMP|int|string $base, int $exp): GMP {}
52+
function gmp_pow(GMP|int|string $num, int $exponent): GMP {}
5353

54-
function gmp_powm(GMP|int|string $base, GMP|int|string $exp, GMP|int|string $mod): GMP {}
54+
function gmp_powm(GMP|int|string $num, GMP|int|string $exponent, GMP|int|string $modulus): GMP {}
5555

56-
function gmp_perfect_square(GMP|int|string $a): bool {}
56+
function gmp_perfect_square(GMP|int|string $num): bool {}
5757

58-
function gmp_perfect_power(GMP|int|string $a): bool {}
58+
function gmp_perfect_power(GMP|int|string $num): bool {}
5959

60-
function gmp_prob_prime(GMP|int|string $a, int $reps = 10): int {}
60+
function gmp_prob_prime(GMP|int|string $num, int $repetitions = 10): int {}
6161

62-
function gmp_gcd(GMP|int|string $a, GMP|int|string $b): GMP {}
62+
function gmp_gcd(GMP|int|string $num1, GMP|int|string $num2): GMP {}
6363

64-
function gmp_gcdext(GMP|int|string $a, GMP|int|string $b): array {}
64+
function gmp_gcdext(GMP|int|string $num1, GMP|int|string $num2): array {}
6565

66-
function gmp_lcm(GMP|int|string $a, GMP|int|string $b): GMP {}
66+
function gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMP {}
6767

68-
function gmp_invert(GMP|int|string $a, GMP|int|string $b): GMP|false {}
68+
function gmp_invert(GMP|int|string $num1, GMP|int|string $num2): GMP|false {}
6969

70-
function gmp_jacobi(GMP|int|string $a, GMP|int|string $b): int {}
70+
function gmp_jacobi(GMP|int|string $num1, GMP|int|string $num2): int {}
7171

72-
function gmp_legendre(GMP|int|string $a, GMP|int|string $b): int {}
72+
function gmp_legendre(GMP|int|string $num1, GMP|int|string $num2): int {}
7373

74-
function gmp_kronecker(GMP|int|string $a, GMP|int|string $b): int {}
74+
function gmp_kronecker(GMP|int|string $num1, GMP|int|string $num2): int {}
7575

76-
function gmp_cmp(GMP|int|string $a, GMP|int|string $b): int {}
76+
function gmp_cmp(GMP|int|string $num1, GMP|int|string $num2): int {}
7777

78-
function gmp_sign(GMP|int|string $a): int {}
78+
function gmp_sign(GMP|int|string $num): int {}
7979

8080
function gmp_random_seed(GMP|int|string $seed): void {}
8181

8282
function gmp_random_bits(int $bits): GMP {}
8383

8484
function gmp_random_range(GMP|int|string $min, GMP|int|string $max): GMP {}
8585

86-
function gmp_and(GMP|int|string $a, GMP|int|string $b): GMP {}
86+
function gmp_and(GMP|int|string $num1, GMP|int|string $num2): GMP {}
8787

88-
function gmp_or(GMP|int|string $a, GMP|int|string $b): GMP {}
88+
function gmp_or(GMP|int|string $num1, GMP|int|string $num2): GMP {}
8989

90-
function gmp_com(GMP|int|string $a): GMP {}
90+
function gmp_com(GMP|int|string $num): GMP {}
9191

92-
function gmp_xor(GMP|int|string $a, GMP|int|string $b): GMP {}
92+
function gmp_xor(GMP|int|string $num1, GMP|int|string $num2): GMP {}
9393

94-
function gmp_setbit(GMP $a, int $index, bool $set_clear = true): void {}
94+
function gmp_setbit(GMP $num, int $index, bool $value = true): void {}
9595

96-
function gmp_clrbit(GMP $a, int $index): void {}
96+
function gmp_clrbit(GMP $num, int $index): void {}
9797

98-
function gmp_testbit(GMP|int|string $a, int $index): bool {}
98+
function gmp_testbit(GMP|int|string $num, int $index): bool {}
9999

100-
function gmp_scan0(GMP|int|string $a, int $start): int {}
100+
function gmp_scan0(GMP|int|string $num1, int $start): int {}
101101

102-
function gmp_scan1(GMP|int|string $a, int $start): int {}
102+
function gmp_scan1(GMP|int|string $num1, int $start): int {}
103103

104-
function gmp_popcount(GMP|int|string $a): int {}
104+
function gmp_popcount(GMP|int|string $num): int {}
105105

106-
function gmp_hamdist(GMP|int|string $a, GMP|int|string $b): int {}
106+
function gmp_hamdist(GMP|int|string $num1, GMP|int|string $num2): int {}
107107

108-
function gmp_nextprime(GMP|int|string $a): GMP {}
108+
function gmp_nextprime(GMP|int|string $num): GMP {}
109109

110-
function gmp_binomial(GMP|int|string $a, int $b): GMP {}
110+
function gmp_binomial(GMP|int|string $n, int $k): GMP {}

0 commit comments

Comments
 (0)