[go: up one dir, main page]

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

gmp throws the wrong error when a GMP object is passed to gmp_init #9308

Closed
MagicalTux opened this issue Aug 12, 2022 · 1 comment
Closed

Comments

@MagicalTux
Copy link

Description

Issue can be found in https://github.com/php/php-src/blob/master/ext/gmp/gmp.c#L624

The following code:

<?php
$x = gmp_init(gmp_init(123));

Resulted in this output:

PHP Warning:  Uncaught TypeError: gmp_init(): Argument #1 ($num) must be of type GMP|string|int, GMP given in php shell code:1

But I expected this output instead:

PHP Warning:  Uncaught TypeError: gmp_init(): Argument #1 ($num) must be of type string|int, GMP given in php shell code:1

PHP Version

8.1.6

Operating System

Gentoo

@damianwadley
Copy link
Member

Looks like just an oversight in the error message itself.

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

4 participants
@MagicalTux @Girgias @damianwadley and others