Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40522 invoked from network); 24 May 2017 18:10:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2017 18:10:04 -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.68 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.68 mail-wm0-f68.google.com Received: from [74.125.82.68] ([74.125.82.68:34081] helo=mail-wm0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/2F-10292-57CC5295 for ; Wed, 24 May 2017 14:09:58 -0400 Received: by mail-wm0-f68.google.com with SMTP id d127so48668681wmf.1 for ; Wed, 24 May 2017 11:09:57 -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=oF9Wo1LSyAW9tYE//jx/SiCztXSEBcCW8maH9DchYew=; b=C8V5wPmr7lSvLA0fFRGo7mZlxen64NnIcvGLbwNJ3jPlaDGN79ft2jNGT2fqO79Mx0 Io4jbXfX4089zU9HWJh3zdOUx9Q6nUnsGfmpQUiB0yL63kdoGb4MynSNmxTxuUqHy+sm ddZC1PvBZcGMQ6CVAM+HlQcLiltpYYxLT5WjyNZW9q4JGkbQmWQdVNJJO5yL3tWVwYet PNGFTGsTgBT4csbUJaembcO/exUS6mBPe7gefGieGbh42wjQP1sQEyHBqZyrwHpxqNXd AR60RkqH1dP4NVo6v8TV23JByhlp+30Kw37WQX7RUpVx0IJwycXh44tgPnunCTNYtp6a UOAg== 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=oF9Wo1LSyAW9tYE//jx/SiCztXSEBcCW8maH9DchYew=; b=Lr9+6E+9FiNYOR8VJ+gmqGPn3UBb0rI3iy+m5tvF5phkJgC74oeUqv/xrtZovY4hhv LRtodAKDQ+hP6X1bQ2xRaYlRkvorQjt9FQ4J8IF7J7lnBs+c79qXBIhJo+4arkha8Q1n dhoXXqxAWzftJJfsG86ElDi7iUZCX/li7Pq+51t/ltM0VHdzcCqydG4wPJMqjOAo7Ka8 iqAo69RFdGfKAujLsjgdJSlYdqvatbGtR4xR9b/4tjJvMVPZlDjDbKSebO32mIcQYJaQ rTp7KLekmJ2ZHCeOk+cO/ll3mrYQ0+VduUoQU1veZYErvq5WOCFalAJsEWEScHbVVxCB QffQ== X-Gm-Message-State: AODbwcA1ifkJr0GUw5BDcp/mWeZE7tjfzV0i9Mt2p8f6jp861Nx2ue1i GiI667JjrQi0QlyPfeJCTCNuqFR/SvT4YJ0= X-Received: by 10.28.147.9 with SMTP id v9mr7674563wmd.80.1495649395133; Wed, 24 May 2017 11:09:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.147 with HTTP; Wed, 24 May 2017 11:09:34 -0700 (PDT) In-Reply-To: References: Date: Wed, 24 May 2017 20:09:34 +0200 Message-ID: To: Fleshgrinder Cc: php-internals , Larry Garfield , Levi Morrison , lists@rhsoft.net, Remi Collet Content-Type: multipart/alternative; boundary="001a1145b054e7d5c905504902f5" Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID From: ocramius@gmail.com (Marco Pivetta) --001a1145b054e7d5c905504902f5 Content-Type: text/plain; charset="UTF-8" On Wed, May 24, 2017 at 8:01 PM, Fleshgrinder wrote: > On 5/24/2017 5:11 PM, Levi Morrison wrote: > > On Wed, May 24, 2017 at 9:04 AM, Larry Garfield > > wrote: > > > >> It doesn't have to be a PECL library. I agree that a project requiring > a > >> PECL library greatly limits its potential reach, but with Composer > >> user-space libraries are totally easy to install. There's a nice and > >> popular UUID implementation already: > >> > >> https://packagist.org/packages/ramsey/uuid > >> > >> Note: That doesn't mean adding UUID functionality to PHP core/standard > lib > >> is a bad idea; discussing that is fine. But the "no one will be able to > >> use it otherwise" argument is substantially less compelling than it was > >> even 5 years ago. > >> > >> --Larry Garfield > > > > > > By the way there already is a PECL package for a UUID library: > > https://pecl.php.net/package/uuid. I would like to see compelling > reasons > > why we shouldn't rally around that package. > > > > What is wrong with `ramsey/uuid`? > > Well, absolutely nothing. I personally would consider it > over-engineered, but that is no real reason. My implementation is after > all not an attack on a well maintained Composer package. The fact that > this package was downloaded almost 10 million times however is an > indicator that that functionality is required a lot. What is an STD for? > Exactly, to provide things that are needed everywhere. This is exactly > the reason why I want to see UUIDs as part of PHP's STD. > Indeed: UUIDs are much, much, much needed feature. > What is wrong with PECL's uuid? > > Of course I know about that package. The problems I have with it are > simple: > > - It just exposes a C API to userland, without considering that PHP is > becoming less and less procedural. > For once, I must say that I disagree with having an OOP API defined in core. This can exist in userland, so it probably should. Internal classes, their reflection, behavior, inheritance model, etc are full of quirks. There's nothing wrong in returning a string, then having a userland lib make it into a UUID value object: it actually is better for everyone's sanity. It would (probably) be better to stop at the function that actually generates the identifier, then having the boxed value defined in userland anyway. Yes, we lose the type hinting, but damn are internal classes ugly. If you must keep the object style, make it `final`, so at least we won't have people extending this thing for no good reason at all :-P Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --001a1145b054e7d5c905504902f5--