The current web3.php was mysteriously returning numbers like this: 70706864786e6862 instead of the full hex from numbers like 70706864786e6862000000000000000000000000000000000000000000000026. It happens only in the edge case where the hex has a single 'e' in it. These changes fix that scenario.
If you're wondering how we found this out, we ran into an edge case with tokenIds in our NFT Smart Contract when we started generating token IDs of the form seriesId + autoIndex. It just so happened that our seriesId had a single e in it. And PHP's is_numericinterprets numbers of the form '123e456' to be decimal representations of large numbers!
The current web3.php was mysteriously returning numbers like this:
70706864786e6862
instead of the full hex from numbers like70706864786e6862000000000000000000000000000000000000000000000026
. It happens only in the edge case where the hex has a single 'e' in it. These changes fix that scenario.If you're wondering how we found this out, we ran into an edge case with
tokenIds
in our NFT Smart Contract when we started generating token IDs of the formseriesId + autoIndex
. It just so happened that ourseriesId
had a singlee
in it. And PHP'sis_numeric
interprets numbers of the form '123e456' to be decimal representations of large numbers!