Comments (3)
I think the problem is perhaps you're running on a PHP interpreter with 32bit integers, could you check the value for PHP_INT_SIZE
?
The current implementation relies on bit arithmetic to improve the performance which in PHP always result on an integer, in your solution it uses standard arithmetic which for big numbers will end up resulting on a floating point number which can end up loosing precision.
Perhaps the library can be changed to fallback to your decoding implementation if after the 4th byte we're still decoding more ($byte > 0x7f
). That way we would still use the in theory faster bit arithmetic for most common cases but support floating point if we go out of the integer range.
from protobuf-php.
Integer max size for me is 9223372036854775807
but when i'm trying to decode message wich contains timestamp in microseconds, i receive wrong number. Using this function i'm getting it right.
Just for comparison:
my way: public 'timestamp' => float 1428581286157
old way: public 'timestamp' => float 79193446
Even with 32 bit integer this number should be much greater
from protobuf-php.
This problem is solved now?
from protobuf-php.
Related Issues (20)
- pear.pollinimini.net is down HOT 7
- protoc-gen-php: command not found HOT 4
- getWireType()
- 400 Bad Request when calling Google service
- Again pollinimini.net is down
- Doesn't play well with mbstring plugin with mbstring.func_overload ini set
- You must provide at least 1 argument
- One class per file, PSR-1 Basic Coding Standard
- pear.pollinimini.net down HOT 2
- proto map is not support?
- Incompatible signatures, cannot compile full HOT 1
- Compatible interfaces HOT 1
- could not extract the package.xml file from "Protobuf-1.0.tgz" HOT 2
- Json codec and enum fields
- protoc-gen-php options ignored
- Missing file when running the benchmark
- Message::_set allows potentially unsafe usage
- Add support for standard Timestamp JSON encoding
- pear.pollinimini.net is down HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf-php.