[
https://issues.apache.org/jira/browse/THRIFT-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112802#comment-18112802
]
Sylwester Lachiewicz edited comment on THRIFT-1538 at 9/8/26 1:45 PM:
----------------------------------------------------------------------
On a 32-bit build {{readI64}} computes {{$hi * 4294967296 + $lo}}
([TBinaryProtocol.php:428|https://github.com/apache/thrift/blob/master/lib/php/lib/Protocol/TBinaryProtocol.php#L428]),
which exceeds {{PHP_INT_MAX}} and becomes a float — the precision loss
reported here. Fixing it exactly would mean carrying i64 as a string or
requiring bcmath/gmp throughout the PHP protocol layer. The reporter patched it
locally and said in 2018 to close it. Won't Fix.
was (Author: slachiewicz):
i64 overflow during deserialization is a 32-bit PHP platform limitation; 32-bit
PHP is long EOL and 64-bit PHP (the supported target for years) handles i64
correctly. Closing as Won't Fix.
> Error during deserialization int64 on 32-bit architecture
> ---------------------------------------------------------
>
> Key: THRIFT-1538
> URL: https://issues.apache.org/jira/browse/THRIFT-1538
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Library
> Affects Versions: 0.2, 0.8
> Environment: Ubuntu 10.04
> Reporter: Dmitry Zolotarev
> Priority: Major
> Labels: bug, php, serialization
> Attachments: hello.php, thrift_test1.tar.bz2
>
>
> Value 5718813258875302619 deserialized as 5718813261021839359
--
This message was sent by Atlassian Jira
(v8.20.10#820010)