Bug #81379 [Ver->Csd]: gmp_init() not accepting GMP values despite saying so

From: Date: Wed, 27 Sep 2023 15:00:26 +0000
Subject: Bug #81379 [Ver->Csd]: gmp_init() not accepting GMP values despite saying so
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245443@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81379&edit=1 ID: 81379 Updated by: nielsdos@php.net Reported by: michelbach94 at gmail dot com Summary: gmp_init() not accepting GMP values despite saying so -Status: Verified +Status: Closed Type: Bug Package: GNU MP related Operating System: Manjaro PHP Version: 8.0.9 -Assigned To: +Assigned To: nielsdos Block user comment: N Private report: N New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Seems to have been fixed in 8.1.11 & 8.2.10 Previous Comments: ------------------------------------------------------------------------ [2021-08-24 13:12:30] nikic@php.net I'm okay with accepting GMP in gmp_init(). ------------------------------------------------------------------------ [2021-08-24 12:10:01] cmb@php.net Indeed. The problem is that convert_to_gmp() is used to convert the arguments of several GMP functions, and all of them but gmp_init() actually accept GMP instances. Maybe just accept GMP instances for gmp_init() as well? ------------------------------------------------------------------------ [2021-08-24 11:37:10] michelbach94 at gmail dot com Description: ------------ gmp_init() is documented to only accept strings and ints. However, its error message says that it also accepts GMP objects while simultaneously saying it does not. Test script: --------------- php > gmp_init(gmp_init(5)); PHP Warning: Uncaught TypeError: gmp_init(): Argument #1 ($num) must be of type GMP|string|int, GMP given in php shell code:1 Stack trace: #0 php shell code(1): gmp_init(Object(GMP)) #1 {main} thrown in php shell code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81379&edit=1

« previous php.bugs (#245443) next »