Snowflake keyword algorithm in PHP using PHPCassa

Possible duplicate:
how to have a 64 bit integer in PHP?

Is it possible to use a 64-bit long integer as a key in Cassandra using PHPCassa?

For instance,

$pool = new ConnectionPool('main', array("127.0.0.1")); $table = new ColumnFamily($pool, 'messages'); // ColumnFamily $table->insert("5601379860409749867", array("sampleKey" => "sampleValue)); 

Every time I do an insert, I get 0 for the key. In this table, the validation_class key is LongType.

+6
source share
1 answer

It completely depends on the capabilities of your server operating system, and not on the restriction of PHPCassa.

Native 64-bit integers require 64-bit hardware and a 64-bit version of PHP.

On 32-bit hardware:

 $ php -r 'echo PHP_INT_MAX;' 2147483647 

On 64-bit hardware:

 $ php -r 'echo PHP_INT_MAX;' 9223372036854775807 
0
source

Source: https://habr.com/ru/post/914270/


All Articles