lightstep / lightstep-tracer-php

The Lightstep distributed tracing library for PHP
https://lightstep.com
MIT License
13 stars 15 forks source link

When running on 32 bit versions of PHP, intval does not correctly convert micros for start and end time. #55

Open BackTrak opened 4 years ago

BackTrak commented 4 years ago

Because the library does not check the return result from the LightStep report API, it does not give any indication that LightStep is rejecting messages from 32 bit PHP with a "can't decode value" error due to the timestamps for the micros values being negative numbers because 32 bit PHP cannot correctly convert the long micros values using only 4 bytes. It would be nice if the module would throw an exception at initialization if it is not being used on a 64 bit platform to give users a clue on why their tracing is not arriving at the server. Detecting 64 bit-ness is easily done with this check:

function is64bitPHP() {
    return PHP_INT_SIZE == 8;
}