summaryrefslogtreecommitdiffstats
path: root/testuuid.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-11-06 17:42:03 +0100
committerRemi Collet <fedora@famillecollet.com>2012-11-06 17:42:03 +0100
commitda300d88f0704b76bf4a602354eeb2ee2e3fdd16 (patch)
tree6d786137efc0bd4577c5af85185af22f77803cc9 /testuuid.php
parent8c44322ae9031ac21177bd24e51796d9004e9528 (diff)
more uuid stuff
Diffstat (limited to 'testuuid.php')
-rw-r--r--testuuid.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/testuuid.php b/testuuid.php
new file mode 100644
index 0000000..0b160a3
--- /dev/null
+++ b/testuuid.php
@@ -0,0 +1,21 @@
+<?php
+
+if (function_exists("uuid_export")) {
+ echo "Version: ".uuid_version()."\n";
+ if (uuid_create($uuid)) {
+ die("Can't create\n");
+ }
+ for ($i=0 ; $i<10 ; $i++) {
+ if (!uuid_make($uuid, UUID_MAKE_V4) && !uuid_export($uuid, UUID_FMT_STR, $str)) {
+ echo "$i: $str\n";
+ }
+ }
+ uuid_destroy($uuid);
+} else if (function_exists("uuid_create")) {
+ for ($i=0 ; $i<10 ; $i++) {
+ echo "$i: ".uuid_create()."\n";
+ }
+} else {
+ die ("No UUID extension\n");
+}
+