Adding code to detect whether this is a 32-bit or 64-bit PHP build

This commit is contained in:
Ben Ramsey
2012-07-19 17:02:19 -05:00
parent e3c1731e21
commit d0ffcb2d4a
4 changed files with 60 additions and 0 deletions
+7
View File
@@ -97,6 +97,13 @@ final class Uuid
*/
protected function __construct($msb, $lsb)
{
if (PHP_INT_SIZE == 4) {
throw new \OverflowException(
'Attempting to create a UUID on a 32-bit build of PHP. This '
. 'library requires a 64-bit build of PHP.'
);
}
$this->msb = $msb;
$this->lsb = $lsb;
}