rfc:uuid
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:uuid [2017/05/26 09:58] – Removed open issue about argument parsing fleshgrinder | rfc:uuid [2017/08/29 07:33] – Fixed broken links fleshgrinder | ||
---|---|---|---|
Line 40: | Line 40: | ||
==== Why C? ==== | ==== Why C? ==== | ||
- | There is no reason why this should be implemented in C. One could argue that it is faster, which it probably is, but this is a weak argument. This RFC would propose the inclusion of UUIDs implemented in PHP if shipping of PHP code as part of the standard module of PHP would be possible. | + | There is no reason why this should be implemented in C. One could argue that it is faster, which it probably is, but this is a weak argument. This RFC would propose the inclusion of UUIDs implemented in PHP if shipping of PHP code as part of the standard module of PHP would be possible. However, there is a C API included that allows other PHP modules to utilize UUIDs. |
=== Why not PECL UUID? === | === Why not PECL UUID? === | ||
Line 46: | Line 46: | ||
==== Why a Class? ==== | ==== Why a Class? ==== | ||
- | UUIDs are basically random data. There is no way for an application to distinguish between a string of 16 bytes (since strings in PHP are random bytes too) and a UUID. This problem can be minimized through the implementation of UUIDs as a class. The code that constraints a type to a UUID has the guarantee that the string is of exactly 16 bytes. The developer that constraints a type to a UUID has the guarantee that the other developer passing a value at least had to have a look at the UUID class. Of course, there is nothing that prevents the other developer from creating UUIDs that are highly predictable, | + | UUIDs are basically random data. There is no way for an application to distinguish between a string of 16 bytes (since strings in PHP are random bytes too) and a UUID. This problem can be minimized through the implementation of UUIDs as a class. The code that constraints a type to a UUID has the guarantee that the string is of exactly 16 bytes. The developer that constraints a type to a UUID has the guarantee that the other developer passing a value at least had to have a look at the UUID class. Of course, there is nothing that prevents the other developer from creating UUIDs that are highly predictable, |
==== Implementation ==== | ==== Implementation ==== | ||
Line 169: | Line 169: | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | Both '' | + | Both '' |
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
Line 191: | Line 191: | ||
===== Open Issues ===== | ===== Open Issues ===== | ||
- | ==== Namespace ==== | + | None |
- | The discussion about namespace in PHP core is on ongoing dispute. This highly self-contained component could easily be provided from an internal namespace and thus lay the grounds for other things to come. This would require additional discussion, but possible namespaces in alphabetical order are ('' | + | |
- | + | ||
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | Other variations, based on the premise that the reserved '' | + | |
- | + | ||
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | ==== Doxygen Documentation ==== | + | |
- | The provided implementation uses [[http:// | + | |
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
Line 217: | Line 198: | ||
===== Future Scope ===== | ===== Future Scope ===== | ||
* [[https:// | * [[https:// | ||
- | * Addition of a '' | + | * Addition of a '' |
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
Line 233: | Line 214: | ||
===== References ===== | ===== References ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
- | * [[https://tools.ietf.org/html/ | + | * [[https://twitter.com/AmbassadorAwsum/status/868097123627171842|Twitter discussion]] |
- | * [[https:// | + | |
===== Rejected Features ===== | ===== Rejected Features ===== | ||
None so far. | None so far. |
rfc/uuid.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1