Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stubs/documentation for missing GMP functions #2924

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Nov 7, 2023

Reference:

I wonder if it makes sense to deprecate the GMP random functions as gmp_random() was deprecated during the 7.X release cycle (we should then also deprecate the gmp_random_seed() function)

@Girgias
Copy link
Member Author

Girgias commented Nov 7, 2023

Note: need to fix gen stub file name generation to make underscore become -

The issue is the GMP docs...

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for constructor

@TimWolla
Copy link
Member

TimWolla commented Nov 8, 2023

I wonder if it makes sense to deprecate the GMP random functions as gmp_random() was deprecated during the 7.X release cycle (we should then also deprecate the gmp_random_seed() function)

I don't think there's a “drop-in” replacement functionality for them, though?

Comment on lines 17 to 18
0 and (2 ** <parameter>bits</parameter>) - 1.
<literal>0</literal> and
<code>(2 ** <parameter>bits</parameter>) - 1</code>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As that changed: That could use <superscript>. See:

The exact maximum can be calculated as 2<superscript>$engine_bytes * 8 - 1</superscript> - 1.

@Girgias
Copy link
Member Author

Girgias commented Nov 10, 2023

I wonder if it makes sense to deprecate the GMP random functions as gmp_random() was deprecated during the 7.X release cycle (we should then also deprecate the gmp_random_seed() function)

I don't think there's a “drop-in” replacement functionality for them, though?

Right, I just find the "bits" variant a bit strange but they do work with arbitrary large integer numbers.

@Girgias Girgias merged commit 45c190a into php:master Nov 15, 2023
2 checks passed
@Girgias Girgias deleted the gmp-missing-docs branch November 15, 2023 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants