Skip to content

Implement GMP::__construct #10225

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

Closed
wants to merge 1 commit into from
Closed

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Jan 4, 2023

Supersedes GH-10158
Fixes GH-10155

Implements a proper constructor for GMP as discussed in both GH-10158 and https://externals.io/message/119216.
Targeting 8.2.x as proposed on the mailing list thread.
cc @Girgias

Not sure if I did everything correctly, looking forward for reviews :)

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits but LGTM otherwise

var_dump(new GMP("12", 999));
} catch (ValueError $e) {
echo $e->getMessage() . "\n";
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the sake of completeness, add a test with a non-numeric string as the number (e.g. 'hello', or '')

@nielsdos
Copy link
Member Author

nielsdos commented Jan 5, 2023

Thanks for the review, I updated the patch with your suggestions.

@nielsdos
Copy link
Member Author

nielsdos commented Jan 5, 2023

I checked the failures, they are unrelated to the code changes.

@Girgias
Copy link
Member

Girgias commented Jan 17, 2023

@ramsey @saundefined @adoy What do you think about landing this in 8.2?

@adoy
Copy link
Member

adoy commented Jan 17, 2023

I see no issue adding this to 8.2.

@Girgias Girgias closed this in 4ea85d4 Jan 19, 2023
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.

None yet

3 participants