Skip to content

ext/gmp: Emit deprecation for precision-losing float RHS in ** / << / >>#21935

Open
LamentXU123 wants to merge 6 commits intophp:PHP-8.4from
LamentXU123:bug-fix-9
Open

ext/gmp: Emit deprecation for precision-losing float RHS in ** / << / >>#21935
LamentXU123 wants to merge 6 commits intophp:PHP-8.4from
LamentXU123:bug-fix-9

Conversation

@LamentXU123
Copy link
Copy Markdown
Contributor

I found this TODO message in the code base

For PHP 8.3 and up use zend_try_get_long()

Ah, so using zend_try_long() here will cause some precision loss and should be fixed after 8.3. So I created this PR targeting 8.4. I don't sure if this worth a NEWS entry. Also may need to merge this PR to other branches since I don't have access :)

cc @Girgias

@devnexen
Copy link
Copy Markdown
Member

devnexen commented May 3, 2026

I think a decision (aka RFC) needs to be made about it first, not entirely sure though.

@LamentXU123
Copy link
Copy Markdown
Contributor Author

I think a decision (aka RFC) needs to be made about it first, not entirely sure though.

There are comments about this in the original code base so maybe this is some sort of TODO task, I think the correct behavior is decided when the comment is written.

Anyway, the code is written in PHP 8.2.6 and I guess the original idea is to correct the behavior after 8.3 when we have the corresponding try method, and people might just forget it :)

@devnexen
Copy link
Copy Markdown
Member

devnexen commented May 3, 2026

oh I do not deny the correctness of it, just talking about this as a whole procedure but let s wait the maintainer's opinion ;)

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.

2 participants