Skip to content

PHP 8.6 | NewFunctions: detect new GMP functions - #2094

Merged
wimg merged 1 commit into
developfrom
php-8.6/newfunctions-gmp
Sep 15, 2026
Merged

wimg merged 1 commit into
developfrom
php-8.6/newfunctions-gmp

Conversation

@jrfnl

@jrfnl jrfnl commented Sep 13, 2026

Copy link
Copy Markdown
Member
  • GMP:
    . Added gmp_powm_sec() for side-channel quiet modular exponentiation.
    Requires GNU MP 5.0.0 or later; it is not available on official Windows
    builds using MPIR.
    . Added gmp_prevprime() to get the largest prime smaller than the given
    number. The optional $definitely_prime output parameter indicates whether
    the returned number is definitely prime, as opposed to probably prime.
    A ValueError is thrown if no such prime exists. This function is available
    only when PHP is built against GNU MP 6.3.0 or later; it is not available
    on official Windows builds using MPIR.
  • GMP:
    . gmp_powm_sec()
    . gmp_prevprime()

This commit accounts for detecting use of the new functions.

Includes test.

Refs:

Related to #2052

> - GMP:
>   . Added gmp_powm_sec() for side-channel quiet modular exponentiation.
>     Requires GNU MP 5.0.0 or later; it is not available on official Windows
>     builds using MPIR.
>   . Added gmp_prevprime() to get the largest prime smaller than the given
>     number. The optional $definitely_prime output parameter indicates whether
>     the returned number is definitely prime, as opposed to probably prime.
>     A ValueError is thrown if no such prime exists. This function is available
>     only when PHP is built against GNU MP 6.3.0 or later; it is not available
>     on official Windows builds using MPIR.

> - GMP:
>   . gmp_powm_sec()
>   . gmp_prevprime()

This commit accounts for detecting use of the new functions.

Includes test.

Refs:
* https://github.com/php/php-src/blob/daf21f4630812168666bfba9ed7de710ebefae4f/UPGRADING#L351-L360
* https://github.com/php/php-src/blob/daf21f4630812168666bfba9ed7de710ebefae4f/UPGRADING#L634-L636
* php/php-src 22852
* php/php-src@081106e
* php/php-src 22807
* php/php-src@7abd493
* php/php-src 22907
* php/php-src@6459664

Related to 2052
@jrfnl jrfnl added this to the 10.0.0-alpha3 milestone Sep 13, 2026
@jrfnl
jrfnl requested a review from wimg September 13, 2026 20:41
@wimg
wimg merged commit b6b5604 into develop Sep 15, 2026
50 checks passed
@wimg
wimg deleted the php-8.6/newfunctions-gmp branch September 15, 2026 15:27
@github-actions github-actions Bot removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants