php-protobuf icon indicating copy to clipboard operation
php-protobuf copied to clipboard

64-bit integers on x86

Open trickyau opened this issue 8 years ago • 2 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?

trickyau avatar Oct 12 '18 07:10 trickyau

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.

hjagodzinski avatar Oct 13 '18 09:10 hjagodzinski

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.

trickyau avatar Oct 13 '18 09:10 trickyau