Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100362 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99447 invoked from network); 4 Sep 2017 05:23:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2017 05:23:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=andigutmans@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=andigutmans@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.53 as permitted sender) X-PHP-List-Original-Sender: andigutmans@gmail.com X-Host-Fingerprint: 74.125.83.53 mail-pg0-f53.google.com Received: from [74.125.83.53] ([74.125.83.53:34924] helo=mail-pg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/E8-04538-533ECA95 for ; Mon, 04 Sep 2017 01:23:03 -0400 Received: by mail-pg0-f53.google.com with SMTP id 63so15855023pgc.2 for ; Sun, 03 Sep 2017 22:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:content-language:mime-version; bh=wtIcITBj1sJhGuPryKEqDKIgOjX8zTH9jefUasZu7s0=; b=OV5CJKv9gwwgG5hbGdnpb/1kWCH7qya0VosVqkHzIKU6fwWoFvHWRzPWuyAqanZWgS x+2lA460U+N2Om21k7wUhoD6cSLfrQ5NazXksDJ7NOu/452WxdvZfuUHf3uD1HfX5hl0 NgcrG43AenDWaFV4twPhntuf3cDenqWLSzSDPVxm54jj49E5hGroLYHBTUme1kMY+9Ru x/26Sh+RrLt6mVtLpxB+OuOzxFMz0+5dcG94wTNRJY8MSNz/s/bJMls0UiJoLCZNaSh+ 7J+n9UW7CoO8OGLxV6rAbF5pHTrUgBVsBHfRFf5ZAuN+H+Jy6ibCmP1NnQjg7JfXdO77 lt1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:content-language :mime-version; bh=wtIcITBj1sJhGuPryKEqDKIgOjX8zTH9jefUasZu7s0=; b=L/ytxO7vypt/Tg/wmssgZeJ+Oa77jwHbLw7IMJiCfuEA5Sf2lkdmrmE02BMOkgXmwY i6MJgqE+Su6fmwJ0pYxxB8kW+pPbrindQDjwt1h7/GhuMYbDbWme63I8BJ+XV6Tezn9m C7Ad2hzACwE+0/ANX3uU2Apg/tZ0IjWfw0Fc3TyBTJmG4mQDJwVX6paazrWd0MmpDtwn 5aKwVefprmjBQFqgwm3F4gNBul1YYtohjjfPp+Wl8t1u8N0w6SWudYh3/rlooTDaFLeY ACLjFibh+PmjfGXws2FwrtAn7aaa16Jkn4cDaqWewbdizP0fsN2bEgY60VmrgKQPQcqn h0rA== X-Gm-Message-State: AHPjjUgQ78eAcrg8FqsGzaDRTSsOPbrcwvMeWgTxAE3HZ7gjyYQbxjxj TZzv9nUBM0rk19MfPDc= X-Google-Smtp-Source: ADKCNb7HA/4dAaeHur85RiJwqYox2d18gz//XH0HZlRbswpbMJrUaj+T407jVikZIzV6GvnCT/On8Q== X-Received: by 10.84.232.206 with SMTP id x14mr3905435plm.412.1504502578172; Sun, 03 Sep 2017 22:22:58 -0700 (PDT) Received: from BN3PR03MB1494.namprd03.prod.outlook.com ([132.245.41.21]) by smtp.gmail.com with ESMTPSA id g20sm9007127pfg.138.2017.09.03.22.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Sep 2017 22:22:56 -0700 (PDT) To: Marco Pivetta CC: PHP Internals List , Zeev Suraski Thread-Topic: [PHP-DEV] [VOTE] UUID Thread-Index: AWJkNjc15jo9YtdWYNBXrhY8TI8n6DA4NTdCYjg0MWYwNkRCMVF6c1BDZzEwR0pBZm5BYdOcSUwW X-MS-Exchange-MessageSentRepresentingType: 1 Date: Mon, 4 Sep 2017 05:22:53 +0000 Message-ID: References: <9f09589f-0a8e-1b8c-7b4c-b7d6899ed4ab@fleshgrinder.com> , In-Reply-To: Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 Content-Type: multipart/alternative; boundary="_000_BN3PR03MB1494E138CAC7C0AAD4D516DDF2910BN3PR03MB1494namp_" MIME-Version: 1.0 Subject: Re: [PHP-DEV] [VOTE] UUID From: andigutmans@gmail.com (Andi Gutmans) --_000_BN3PR03MB1494E138CAC7C0AAD4D516DDF2910BN3PR03MB1494namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable If we say it is a ubiquitous need and Spl stands for "Standard PHP Library"= and namespace is already taken then why not? Better than breaking BC on a = global UUID... Get Outlook for iOS ________________________________ From: Marco Pivetta Sent: Sunday, September 3, 2017 10:30:53 AM To: Andi Gutmans Cc: PHP Internals List; Zeev Suraski Subject: Re: [PHP-DEV] [VOTE] UUID Why would it go under Spl? Spl is already bloated with loads of unrelated c= lasses 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 t= o put standard methods. I would definitely not make functionality like this a top level class/names= pace both for BC reasons and it is a minor capability that fits in well int= o 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 bet= ter than uniqid() built into the language. > 1. I think a renewed discussion, beyond the two days of discussion 3+ mon= ths ago would be useful, as beyond that basic (yet important) point - I hav= e thoughts about a bunch of things in the RFC, and honestly didn't even not= ice the brief discussion months ago (if there was another one then my apolo= gies, 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() N= ikita proposed) would make perfect sense. Forcing the use of classes/objec= ts in such a case - where there's little to no added value, is wrong and un= common (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 nam= espace. However, the risk of the introduction of them is considered to be v= ery low, since the global namespace should not be used by PHP users." > ... erroneously assumes that all code in PHP utilizes namespaces. IMHO t= his is a projection of a particular coding style onto the entire PHP userba= se. We haven't deprecated at any point the ability to place user classes i= n the global namespace, we haven't even as much as said at any point we mig= ht 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 int= roducing - 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 t= ext 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 absolutel= y matters. If we manage to get JIT out the door and the performance differ= ences become negligible - then I see a lot of value in moving some of our c= ore 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 somethin= g along the lines of uuid_v4_create() in a heartbeat. > $bin =3D \UUID::v4()->toBinary(); $hex =3D \UUID::v4()->toHex(); $str =3D \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 --_000_BN3PR03MB1494E138CAC7C0AAD4D516DDF2910BN3PR03MB1494namp_--