Subject | Generators, BIGINTs and handling them in PHP. |
---|---|
Author | Max dAyala |
Post date | 2008-02-26T21:08:11Z |
Hello everyone, I've just joined the list. I'm currently working on a
project with PHP and Firebird 2.0, having just moved up from Firebird 1.5.
One thing I've found out is that Firebird 2 generators produce
Bigints, whereas PHP will only handle 32 bit integers on the Linux
platform I'm using. When I get Bigint values back from the database
PHP presents them to me as strings. Hence, I've run into a few
problems where I've been working with integer values but various PHP
functions of mine now fail because they are designed to handle
integers rather than strings.
While I can fix up individual errors I find, I was wondering if anyone
has any experience of generalising number handling in PHP that would
cope with both strings and number values.
In the PHP manual there are GMP Functions:
http://www.php.net/manual/en/ref.gmp.php
Also other libs such as PEAR Bigint:
http://pear.php.net/reference/Crypt_RSA-1.0.0/Crypt_RSA/_Crypt_RSA-1.0.0_RSA_Math_BigInt_php.html
Has anyone used these, or anything similar, and are there any
significant performance issues when using these functions.
Thanks for any feedback you can offer.
Max
project with PHP and Firebird 2.0, having just moved up from Firebird 1.5.
One thing I've found out is that Firebird 2 generators produce
Bigints, whereas PHP will only handle 32 bit integers on the Linux
platform I'm using. When I get Bigint values back from the database
PHP presents them to me as strings. Hence, I've run into a few
problems where I've been working with integer values but various PHP
functions of mine now fail because they are designed to handle
integers rather than strings.
While I can fix up individual errors I find, I was wondering if anyone
has any experience of generalising number handling in PHP that would
cope with both strings and number values.
In the PHP manual there are GMP Functions:
http://www.php.net/manual/en/ref.gmp.php
Also other libs such as PEAR Bigint:
http://pear.php.net/reference/Crypt_RSA-1.0.0/Crypt_RSA/_Crypt_RSA-1.0.0_RSA_Math_BigInt_php.html
Has anyone used these, or anything similar, and are there any
significant performance issues when using these functions.
Thanks for any feedback you can offer.
Max