note 41978 modified in function.ibase-gen-id by abies
| From: | abies@php.net | Date: | Sun, 02 May 2004 12:11:53 +0000 |
| Subject: | note 41978 modified in function.ibase-gen-id by abies | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69107@lists.php.net to get a copy of this message | ||
Question arose on php-dev:
How does ibase_gen_id() handle 64bit values?
Interbase 6/Firebird generators are always 64-bit signed integers
(Firebird's BIGINT type), regardless of the platform the client is
running.
On 64-bit platforms, this will never require conversion as PHP's int
type is 64 bits wide on those platforms. On 32-bit platforms, the
generated value is converted to a string if it exceeds the limits of a
32-bit signed integer.
(This behaviour is consistent with the ibase_fetch_*() functions, that
will use strings to represent numerical values that cannot be represented
accurately using native PHP numerical types.)
[Edited by PHP/Interbase maintainer.]
--was--
Question arose on php-dev:
How does ibase_gen_id() handle 64bit values?
On 64bit platforms a check is done whether the value fits into PHPs long
value and if not, a string with the value and not an integer is
returned.
[Editor's note: Interbase 6/Firebird generators are always 64-bit signed
integers, regardless of the platform the client is running. On 64-bit
platforms, this will never require conversion as PHP's int type is 64
bits wide on those platforms. On 32-bit platforms, the generated value
is converted to a string if it exceeds the limits of a 32-bit signed
integer.]
http://www.php.net/manual/en/function.ibase-gen-id.php