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

Unexpected result of gmp_pow with huge exponent #16500

Closed
YuanchengJiang opened this issue Oct 19, 2024 · 2 comments
Closed

Unexpected result of gmp_pow with huge exponent #16500

YuanchengJiang opened this issue Oct 19, 2024 · 2 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
var_dump(gmp_pow("256", PHP_INT_MAX));

Resulted in this output:

object(GMP)#1 (1) {
  ["num"]=>
  string(8) "16777216"
}

But I expected this output instead:

it should alert an overflow?

Or should have a limit for exponent?

PHP Version

nightly

Operating System

ubuntu 22.04

@devnexen
Copy link
Member

There is a related ongoing PR.

@YuanchengJiang
Copy link
Author

sure. I will close it

@cmb69 cmb69 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants