You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently, the library aborts, instead of signaling failure by some other means. At least mpir 3.0.0, which we use on Windows (and which is no longer maintained), aborts even on memory allocation failures. If gmplib behaves the same, it might not something we can fix.
<?php$a = gmp_init(10000000000);
var_dump(pow($a, $a)); // or var_dump($a**$a);
PHP Fatal error: Uncaught ValueError: Exponent must be between 0 and 4294967295 in C:\Users\admin\Desktop\bench.php:3
Stack trace:
#0 C:\Users\admin\Desktop\bench.php(3): pow(Object(GMP), Object(GMP))
#1 {main}
thrown in C:\Users\admin\Desktop\bench.php on line 3
Fatal error: Uncaught ValueError: Exponent must be between 0 and 4294967295 in C:\Users\admin\Desktop\bench.php:3
Stack trace:
#0 C:\Users\admin\Desktop\bench.php(3): pow(Object(GMP), Object(GMP))
#1 {main}
thrown in C:\Users\admin\Desktop\bench.php on line 3
Activity
cmb69 commentedon Oct 19, 2024
Apparently, the library aborts, instead of signaling failure by some other means. At least mpir 3.0.0, which we use on Windows (and which is no longer maintained), aborts even on memory allocation failures. If gmplib behaves the same, it might not something we can fix.
cmb69 commentedon Oct 19, 2024
I think we should call
mp_set_memory_functions()to install ZendMM.PS: see #16507.
cmb69 commentedon Oct 19, 2024
Possibly partial fix for this issue on Windows: BrianGladman/mpir@33be900
LamentXU123 commentedon Jul 19, 2026
This is now solved. Closing.