Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98555 invoked from network); 25 May 2017 10:47:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2017 10:47:34 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.86 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.86 mx105.easyname.com Received: from [77.244.243.86] ([77.244.243.86:48547] helo=mx105.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/D5-10292-546B6295 for ; Thu, 25 May 2017 06:47:33 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dDqIj-00064v-Ba; Thu, 25 May 2017 10:47:30 +0000 References: To: Nikita Popov , =?UTF-8?Q?Micha=c5=82_Brzuchalski?= , php-internals Message-ID: <528c5daf-d1ef-5578-3ae5-427b4742ce01@fleshgrinder.com> Date: Thu, 25 May 2017 12:47:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4gJf3GHp9NA0OLAT8EFStUBUoUm6ngXUH" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID From: php@fleshgrinder.com (Fleshgrinder) --4gJf3GHp9NA0OLAT8EFStUBUoUm6ngXUH Content-Type: multipart/mixed; boundary="UuSuvinlsS6WuFjtuad9hGNvevt1g5c9S"; protected-headers="v1" From: Fleshgrinder To: Nikita Popov , =?UTF-8?Q?Micha=c5=82_Brzuchalski?= , php-internals Message-ID: <528c5daf-d1ef-5578-3ae5-427b4742ce01@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID References: In-Reply-To: --UuSuvinlsS6WuFjtuad9hGNvevt1g5c9S Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/25/2017 12:34 PM, Micha=C5=82 Brzuchalski wrote: > 2017-05-25 12:14 GMT+02:00 Nikita Popov : >> I'm wondering if just adding a uuid_v4_create() function (directly >> returning a UUID string) might not cover the 95% use case here. My gen= eral >> impression is that that's what people are usually interested in -- par= sing >> UUIDs etc. seems to be a rather niche concern. >> >> Nikita >> >=20 > I've looked on `Ramsey\Uuid` usages in `prooph/event-store`, > `prooph/common` and also > `broadway/broadway` with `broadway/uuid-generator` - most of use cases = is > generating > UUID and dumping to string and to bytes. But there is sometimes used > UuidInterface not mentioning > this interface functions, creating Uuid object guarantees the object is= > valid UUID which is not true while > using string dumped UUID generated using functions like `uuid_v4_create= ()` > there's need for > additional check if given string really is a valid UUID - which is not > needed while using specialised object. >=20 That is exactly the reason for the class. It is not to be super fancy OO to be cool. It is for type safety. Strings in PHP are random bytes, UUIDs are random bytes, how can you distinguish them? With a UUID type-hint. :) --=20 Richard "Fleshgrinder" Fussenegger --UuSuvinlsS6WuFjtuad9hGNvevt1g5c9S-- --4gJf3GHp9NA0OLAT8EFStUBUoUm6ngXUH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZJrY3AAoJEOKkKcqFPVVrhCQP/1OH0z1jp+v2LiOz/bjvIrre NeNSDwLQPk5H9HfnrKsbmsJ2bBMFdiTt9ObTC0r/AUPJIDmUw4bhdgt4hEaXrF33 XD1H2+dYtrKiEPzno7/81VzJYGqRtQeXDegLqcIhBL8fyxLB9sGn+3NrVJ1jT5oM ub2Ll6xR7ZNiA41Wxc9dpGeBhV6OlTLRdsHw9lcMiOVLoh8bhqZ7zaHWNL/ceTuZ U8GL9qDzdp1t3q55aWRhwU1fEnz+ny5rJzqKX1QSozsfwkggmpKuXIm+TruEbEik URxTQUAZa3xtLqV6iPnWNyR7YSrz6lxUm3t1VQAgwWMW7Nsv4gZ1l+8jWWwlxRXa mFWWanrFkYtf1QYTRSd68eXgTqK+/eQe8nrIxrt1sptIADE89QqKnc076a3RZpnU XAoj4zz5Tz4a7A6K7Tms2ZlLVnkgN2gYNYOHr7nTpp9+eHDst6bjyXgqIr2bQcz+ gsAzyNYvz8ur56I+dsPYUQ1VfMVJ8bx/0ysmGDJ/tJ9EpDwF4B7eMC3y0NwnuTqn +b208FpkfpjqzHfxwqnavTCsIawyZiphu01cwLw2yrvgSsotISMXv5OL74KFfFb3 BoS1is4ebP+ONbdzl+5zGoMc1bVWK9a3vY5mgS694+tFdYIcfacAJci11XHlvk5j 9kKvd/oZJfuwxHMYmuae =PuOZ -----END PGP SIGNATURE----- --4gJf3GHp9NA0OLAT8EFStUBUoUm6ngXUH--