Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100357 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66497 invoked from network); 3 Sep 2017 17:31:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2017 17:31:00 -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 209.85.128.194 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.128.194 mail-wr0-f194.google.com Received: from [209.85.128.194] ([209.85.128.194:36096] helo=mail-wr0-f194.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/16-04538-25C3CA95 for ; Sun, 03 Sep 2017 13:30:59 -0400 Received: by mail-wr0-f194.google.com with SMTP id 40so2330187wrv.3 for ; Sun, 03 Sep 2017 10:30:58 -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=AEPQosN7Uuyz0j6fJk5/a4E1fIKC/t4iiosycxqk5/I=; b=D1MU4o/W1StJIecSAOQ3XCbEWbSoqoSH21weDGsrcU2Z8ydkHw3Rd/RQA8J7kQlc8O EofZqeRUZIfByqxUYH8bxANROVaJ5QI6i+JrlP65z2pUptwWtRHMqBR5veEZk0weFeq8 9bDgVbSIgM5XeS4q0hUXBFNyPnYEInIFE87rnbWY5gmEayN6EiXsslkFPquDvbqX187k Hb3bzxPkMhVZeZyKUPdxfwz6OfoDunrl78iaBElT6sqhwOJq1CgL/F1pBD97vM1FuxaR tiePDrMgDWrjJk784DD2E04CJ8jVcR2S/Nhuq2wGNKovci+xh5ngR/en1fgqXkdHoa9O nFEg== 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=AEPQosN7Uuyz0j6fJk5/a4E1fIKC/t4iiosycxqk5/I=; b=obq9uAnD3gbefeSnY5CBfsZSSx/PHD+/G1uO3aBVdZv0CzgaIMY0KtygpsM1LBhaMi /X2RGdLhKR57WQMp5Mhh8MRXmbtEjRK+CpdwhqLU4IVqNlcz2yXxlTvjy1z/nrEBIQJd u371ouV6QJPEkdRsCorBUbfsUVMAaUjr/vkA5TL9fGSkW5LNe+636RPj3NX4ZpjgNONi cXpzvhXffA+2FgOj4RciXdoJtp3oCWgVLbqwrIezJ8KciQPAXfZ3CQdJhwxCZJpkxZ6J k52F+oKMy+ARnRQd5d83IJgUZQNd3whkb8JZYCfzuZPcKEFse3N8DlFf014hHdrOv516 oWig== X-Gm-Message-State: AHPjjUgHPAdDIYVAxuFTihohYryb/sZjduSF8uH4KfI2uP1CsIW6nugC KqICP8EPozdJAv/CvcgAVZNux5whVg== X-Google-Smtp-Source: ADKCNb4CGJovtihSMFahUZNUh6irBrbWQgUb98U7rSXySQFpLG4jGqzyGwanSfkYraTwztIH9UFQex0IjhxrADkGu1M= X-Received: by 10.223.149.99 with SMTP id 90mr3238690wrs.280.1504459855148; Sun, 03 Sep 2017 10:30:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.177.154 with HTTP; Sun, 3 Sep 2017 10:30:53 -0700 (PDT) Received: by 10.223.177.154 with HTTP; Sun, 3 Sep 2017 10:30:53 -0700 (PDT) In-Reply-To: References: <9f09589f-0a8e-1b8c-7b4c-b7d6899ed4ab@fleshgrinder.com> Date: Sun, 3 Sep 2017 19:30:53 +0200 Message-ID: To: Andi Gutmans Cc: PHP Internals List , Zeev Suraski Content-Type: multipart/alternative; boundary="94eb2c0df1e43ebcd905584c5b59" Subject: Re: [PHP-DEV] [VOTE] UUID From: ocramius@gmail.com (Marco Pivetta) --94eb2c0df1e43ebcd905584c5b59 Content-Type: text/plain; charset="UTF-8" Why would it go under Spl? Spl is already bloated with loads of unrelated classes with no real logical grouping. On 3 Sep 2017 19:03, "Andi Gutmans" wrote: Why would we not just add this under Spl? Feels like an appropriate place to put standard methods. I would definitely not make functionality like this a top level class/namespace both for BC reasons and it is a minor capability that fits in well into a standard library context. Get Outlook for iOS ________________________________ From: Fleshgrinder Sent: Saturday, September 2, 2017 3:43:09 AM To: Zeev Suraski; internals@lists.php.net Subject: Re: [PHP-DEV] [VOTE] UUID Hey Zeev :) On 9/2/2017 12:14 PM, Zeev Suraski wrote: > I just voted 'no', and I'd like to quickly explain why: > > 0. I agree with the premise of the RFC, that we should have something better than uniqid() built into the language. > 1. I think a renewed discussion, beyond the two days of discussion 3+ months ago would be useful, as beyond that basic (yet important) point - I have thoughts about a bunch of things in the RFC, and honestly didn't even notice the brief discussion months ago (if there was another one then my apologies, I couldn't find it). The discussion was really ongoing for a long time, and actually very heated as well. It was on GitHub with lots of comments, Internals, Reddit, Twitter, ... everywhere. On 9/2/2017 12:14 PM, Zeev Suraski wrote: > 2. I think that a function that returns a string (a-la uuid_v4_create() Nikita proposed) would make perfect sense. Forcing the use of classes/objects in such a case - where there's little to no added value, is wrong and uncommon (possibly unprecedented) in PHP. DateTime? SPL? Intl? On 9/2/2017 12:14 PM, Zeev Suraski wrote: > 3. The section dealing with backwards incompatible changes, states: > "Both UUID and UUIDParseException are now globally defined classes, which might collide with user defined classes of the same name in the global namespace. However, the risk of the introduction of them is considered to be very low, since the global namespace should not be used by PHP users." > ... erroneously assumes that all code in PHP utilizes namespaces. IMHO this is a projection of a particular coding style onto the entire PHP userbase. We haven't deprecated at any point the ability to place user classes in the global namespace, we haven't even as much as said at any point we might be considering it - and I don't think we should, either. My gut feel, backed by a quick Google search refutes the assumption that the risk of introducing - at least the UUID class - is very low. Not that I have a better suggestion (other than not introducing a class at all) - but I think the text there should be changed as it does not reflect reality. The very same would be true for any function that is being introduced in the global namespace. I had an RFC for namespaces prepared and ready for vote; incl. a namespaced UUID implementation. However, the feedback on it was so extremely negative and hostile that I decided to withdraw it. On 9/2/2017 12:14 PM, Zeev Suraski wrote: > 4. If I voted yes, it would also mean I agree with a statement such as "One could argue that it is faster (C implementation), which it probably is, but this is a weak argument". I disagree it's a weak argument - and I do think that for basic building blocks of the language, performance absolutely matters. If we manage to get JIT out the door and the performance differences become negligible - then I see a lot of value in moving some of our core value to PHP - but not before then. I would agree, but most people think differently. The wording is a result of the discussions. On 9/2/2017 12:14 PM, Zeev Suraski wrote: > 5. Given we seem to agree this is a basic building block of the language (as it is in other languages), I do think it should be a 2/3 majority vote and not a 50%+1 one. Taking the "is this something we can easily change w/o affecting BC" test, this clearly gets a 'no'. Actually we can. Both classes are final and users cannot extend them. The only thing we cannot do is rename the stuff that's already in them. This is one of the reasons why I kept the provided functionality to a bare minimum. On 9/2/2017 12:14 PM, Zeev Suraski wrote: > To summarize - I'm strongly in favor of fixing this issue in PHP, but at the same time against the proposed solution. I'd vote in favor of something along the lines of uuid_v4_create() in a heartbeat. > $bin = \UUID::v4()->toBinary(); $hex = \UUID::v4()->toHex(); $str = \UUID::v4()->toString(); You can already use it like you want, with greater possibilities and freedom. Incl. auto-completion with your favorite editor to explore your possibilities, and type-safety everywhere as an opt-in. -- Richard "Fleshgrinder" Fussenegger --94eb2c0df1e43ebcd905584c5b59--