allegro / php-protobuf

PHP Protobuf - Google's Protocol Buffers for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

64-bit integers on x86

trickyau opened this issue · comments

I've been working with some data that uses 64-bit numbers lately on x86 machine, after some debugging I've noticed my values were PHP_INT_MAX.

I was under impression that 64-bit integers strings on x86 when over PHP_INT_MAX should be string not a double, at least that's how it is on Google's implementation.

  • For 64-bit integers type (int64/uint64/sfixed64/fixed64/sint64), use PHP integer on 64-bit environment and PHP string on 32-bit environment.

Is there any plans for changing this?

Google's approach seems to be reasonable - except keeping original value gives a easy way to see it's actual value. May I ask what except being compatible with Google's official implementation this change would give you?

We don't plan to further develop this project as it meets our needs as it is. PRs are more than welcome from the community though.

Well as is I can't work with 64-bit integers on x86 which is my only downfall, other then that I have no problems with the extension.