-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Implement GMP::__construct #10225
Conversation
There was a problem hiding this 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"; | ||
} |
There was a problem hiding this comment.
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 ''
)
89d4388
to
9931f43
Compare
Thanks for the review, I updated the patch with your suggestions. |
I checked the failures, they are unrelated to the code changes. |
@ramsey @saundefined @adoy What do you think about landing this in 8.2? |
I see no issue adding this to 8.2. |
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 :)