CodeExplorer uuid_compare example
public function toRfc4122(): string
{ return $this->uid;
} public function compare(AbstractUid
$other): int
{ if (false !==
$cmp =
uuid_compare($this->uid,
$other->uid
)) { return $cmp;
} return parent::
compare($other);
} private static function format(string
$uuid, string
$version): string
{ $uuid[8
] =
$uuid[8
] & "\x3F" | "\x80";
$uuid =
substr_replace(bin2hex($uuid), '-', 8, 0
);
$uuid =
substr_replace($uuid,
$version, 13, 1
);