I am using cassandra timeuuid in my project. But unable to create timeuuid due to integer limits.
$time = time();
$tS = new Cassandra\Timeuuid($time);
echo("Time Stamp : " . $time . "</br>");
echo("Time UUID : " . $tS . "</br>");
echo("UUID TS : " . $tS->time() . "</br>");
If I run above code I am getting following result.
Time Stamp : 1519110425
Time UUID : 07e0a090-2ba3-11b2-a264-4f5a3b4facaa
UUID TS : 1519110
This means that Timeuuid constructor expects timestamp in milliseconds. But if I try to pass the parameter in milliseconds, it is hitting the integer limit for my php (32bit).
$time = time();
$tS = new Cassandra\Timeuuid($time * 1000);
echo("Time Stamp : " . $time . "</br>");
echo("Time UUID : " . $tS . "</br>");
echo("UUID TS : " . $tS->time() . "</br>");
Getting following error for the above code.
Fatal error: Uncaught Cassandra\Exception\InvalidArgumentException: Invalid argument - integer or string expected in testFile.php:9 Stack trace: #0 testFile.php(9): Cassandra\Timeuuid->__construct(1519110640000) #1 {main} thrown in testFile.php on line 9
Since it is above the integer limit it is getting casted to float.
Any idea how can i solve this problem ?