The community forums are in BETA and closed to the public.

History doesn't page correctly in 32 bit versions of PHP

The pubnub PHP library 'Pubnub-PHP/3.7.6' doesn't work correctly on devices where PHPINTMAX shows that it is running on a 32 bit version of PHP.

The reason for this is that the history returns data in the form:

 date_from: 14287954992229000
 date_to: 14287967997716000

So the tokens for the history are 64 bit integers.

Yet if we look at the PHP 'history' code it typecasts the parameters to integers. eg:

$query['start'] =(int)$args['start']; 
$query['end'] = (int)$args['end'];

.. meaning that it truncates the data on a 32 bit PHP. (So 14287967997716000 above will end up as -921639706)

This means that the history being returned is almost a random subset - not the data requested.

Worst still, while iterating to get more than 100 entries you will often end up in infinite loops, as it takes the same subset each time instead of incrementing to the next one.

-- Mac

Mac, thanks for reporting this. It is unlikely that we will be making any mods to make this 32 bit compatible. If you have a critical requirement, please submit to support where we can provide further assistance.

Login or Signup to post a comment