Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99178 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21969 invoked from network); 25 May 2017 15:48:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2017 15:48:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:36498] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/79-10292-ACCF6295 for ; Thu, 25 May 2017 11:48:26 -0400 Received: by mail-wm0-f52.google.com with SMTP id 7so96656832wmo.1 for ; Thu, 25 May 2017 08:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xXerEJMiWMyUjSU7sbcGyQDWKslQaKzbuYQDfMW4FSA=; b=TY8SSxwrBWYJG7zAAoHprs0ToN123NJYKsqzW5ZoiTCnYcxU02vVS/Hbp9XXDVjXBB 7z5HRVrULEMgoIWIG7P1tRWEBg+1T3I9xG7kOAHP5Mzzl2I6plQ+X10xfYMRTeACN0UR zLZNH75n6hMfsxu3u4EVRx2obOtE+m+MhEO7VzxszIAVl5Mfs48dU2DamFLs/blPBOZY X8x7eJOSdWdCtQmLftxkZqEJrzHzOIzs+DH5E2zAlc7v73UWLq+ybd2b9xT3JRrf6CGN ppleTukiHboc3oAhJOKmZOV+N0yNsGESChjTROSsl8CDbwadGVvNYYiF8ghQZL/GTLr3 wowg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xXerEJMiWMyUjSU7sbcGyQDWKslQaKzbuYQDfMW4FSA=; b=AKJtKlaxJIMgk89qnqic8Z3vcGjzFb1qdKtUkqOLH5bJuxDKOV9Zd2X2+Ti5hj7Ual XAe8du1syKKah7Gqc2mTfvnHnQvlTPakr89sMQrhXqgwhsR0/D/b5jgCm+oebCrEUoB+ 0UEGNjtnOiScNOXN+8cKXC9EJLOKelwtlLwjbfkL1CSdgCvmCxsWNfu59PSfEO3cBbGk /qWxU4nvscrHPbMTcMwYboO93GL7Isq6hQuGGKKSXQpLKASsgG4fu0vf1vkdEnSkTl2b NuLGrF7CJJvKcUZHeZvOjj0eltrVEmUX3SQMS6Cv8rbkRCVFGfZ/Cg5+06ySiohwNouh Hapg== X-Gm-Message-State: AODbwcD7JdUFSQkwjWP5PvcPT3DAYcfr6F4QL1qbTxczavRc6scysHMg v4ypSJO/IYqx52gU5xXJR8OiDbPT9VBHjIo= X-Received: by 10.28.136.85 with SMTP id k82mr9828151wmd.55.1495727303429; Thu, 25 May 2017 08:48:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.147 with HTTP; Thu, 25 May 2017 08:48:02 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 May 2017 17:48:02 +0200 Message-ID: To: Nikita Popov Cc: Fleshgrinder , php-internals , Ben Ramsey Content-Type: multipart/alternative; boundary="001a1144354c9a13ab05505b26ed" Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID From: ocramius@gmail.com (Marco Pivetta) --001a1144354c9a13ab05505b26ed Content-Type: text/plain; charset="UTF-8" Hey Nikita, On Thu, May 25, 2017 at 12:14 PM, Nikita Popov wrote: > On Thu, May 25, 2017 at 12:05 PM, Fleshgrinder > wrote: > >> On 5/24/2017 10:12 PM, Ben Ramsey wrote: >> > I'll take a look at the patch soon. If this is accepted to the core, >> > I'll probably add an adapter to ramsey/uuid that wraps this >> > implementation. The point of the "over engineering" there is to provide >> > choice. Some users want to generate bytes from sources other than >> > random_bytes() (i.e., libsodium) or encode UUIDs in different ways >> > (i.e., ordered time). A UUID generator in the core will only help to >> > improve ramsey/uuid, providing more choice and better performance. >> > >> > I may split out the less-used adapters and codecs into separate >> > components in version 4 or 5 of ramsey/uuid, though, since most users >> > don't need anything other than the default. >> > >> > -Ben >> > >> >> Yes, exactly. >> >> The provided implementation does not have any of the options your >> library offers. There are no special formatters, no accessors for e.g. >> time (not applicable to v3, v4, and v5), no RNG choices, no mutability, >> ... well ... nothing. It is just a straight UUID implementation. >> >> I also hope that this implementation will help to get rid of uniqid at >> some point. >> >> -- >> Richard "Fleshgrinder" Fussenegger >> > > 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 general > impression is that that's what people are usually interested in -- parsing > UUIDs etc. seems to be a rather niche concern. > > Nikita > I'd say that a good example of how this would change things is the `DateTime` object. How many times do you see people passing around `DateTime` objects, and how many times do you see *valid* (not wordpress) use-case scenarios where a datetime string is thrown around? That's the kind of change that a built-in type may trigger here. I had issues about this due to the squishy behavior of the reflection API with internal classes, but Richard covered every rough edge, as per discussion above. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --001a1144354c9a13ab05505b26ed--