Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100351 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82418 invoked from network); 2 Sep 2017 10:43:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2017 10:43:20 -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.85 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.85 mx104.easyname.com Received: from [77.244.243.85] ([77.244.243.85:45097] helo=mx104.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/80-04538-54B8AA95 for ; Sat, 02 Sep 2017 06:43:18 -0400 Received: from cable-81-173-135-10.netcologne.de ([81.173.135.10] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1do5tN-0002sv-3h; Sat, 02 Sep 2017 10:43:10 +0000 Reply-To: internals@lists.php.net To: Zeev Suraski , "internals@lists.php.net" References: Message-ID: <9f09589f-0a8e-1b8c-7b4c-b7d6899ed4ab@fleshgrinder.com> Date: Sat, 2 Sep 2017 12:43:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PGu5HO2wl0WV4hpWIJtfNKSTmDW12Ae5m" X-DNSBL-BARRACUDACENTRAL: YES X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [VOTE] UUID From: php@fleshgrinder.com (Fleshgrinder) --PGu5HO2wl0WV4hpWIJtfNKSTmDW12Ae5m Content-Type: multipart/mixed; boundary="0Oj97LkvT37jtdppwDBowlUAX7apPqHSu"; protected-headers="v1" From: Fleshgrinder Reply-To: internals@lists.php.net To: Zeev Suraski , "internals@lists.php.net" Message-ID: <9f09589f-0a8e-1b8c-7b4c-b7d6899ed4ab@fleshgrinder.com> Subject: Re: [PHP-DEV] [VOTE] UUID References: In-Reply-To: --0Oj97LkvT37jtdppwDBowlUAX7apPqHSu Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hey Zeev :) On 9/2/2017 12:14 PM, Zeev Suraski wrote: > I just voted 'no', and I'd like to quickly explain why: >=20 > 0. I agree with the premise of the RFC, that we should have something b= etter than uniqid() built into the language. > 1. I think a renewed discussion, beyond the two days of discussion 3+ m= onths 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 ev= en 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/o= bjects 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, whi= ch might collide with user defined classes of the same name in the global= namespace. However, the risk of the introduction of them is considered t= o be very low, since the global namespace should not be used by PHP users= =2E" > ... erroneously assumes that all code in PHP utilizes namespaces. IMHO= this is a projection of a particular coding style onto the entire PHP us= erbase. We haven't deprecated at any point the ability to place user cla= sses in the global namespace, we haven't even as much as said at any poin= t 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) - b= ut I think the text there should be changed as it does not reflect realit= y. 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 a= bsolutely matters. If we manage to get JIT out the door and the performa= nce differences become negligible - then I see a lot of value in moving s= ome 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 langua= ge (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 ch= ange 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 a= t the same time against the proposed solution. I'd vote in favor of some= thing along the lines of uuid_v4_create() in a heartbeat. >=20 $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. --=20 Richard "Fleshgrinder" Fussenegger --0Oj97LkvT37jtdppwDBowlUAX7apPqHSu-- --PGu5HO2wl0WV4hpWIJtfNKSTmDW12Ae5m 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 iQIcBAEBCAAGBQJZqos9AAoJEOKkKcqFPVVrbSUQAJD5ymTe2r+KT7D3B3uQgkoY I3bPJT0BOue35L/YgYmdZEX5/Gv8Qp/pguL3pTNVqU9XM4n7AxVc1UrNCUbf4Lb2 lIEdvwg6RvwsOxEboi3yea6r73HEraFR4sdbaGuuZua0fe5bvoCDDnZABOyyP+be oL7q4m6gW3YaYN0Frk9Iwyrnq5yipHEMUQQ6Y5ZiVV5u11fPykCeqQgdllavCroB N9OUWn5mr0MD1nuUwf6gojFcSLWI/XTFnKogjiVRU9iFjUDMK7BzUBQlxRUQbCXM UQ6ct099FjoPgvI1QeTTWOXOmJ7htWh/WSbOpmFbiIKsk+Vl5z/TqW3G5aeaYc8w dGENj4ssJ3/ki3d7jHzxLdNPiTQdBN1yM0kaiws46XqeNz2rlSAG6wifRcsPIHRB fi24QwPuTtRizd0yLNFgVRC5N2+vE+XhEMpu7Vw6rzXA+wjpRLXYn6I+G6Ue1Euv KkeMMmLrx+hm3FHd47dNoPA1lFq4sUpcGEqyMxZNG0M5m60xZkMYU4lUgO/9pzDt r4CoUtrAB/cshJeAZXZwTxGqhTaEhSiE9+8yK/dH1f7m+etc7ZbtQoQEJRhnn0Fx dqlBVc8x20VZhKwg5Ral+d7ed4x9EFY1hQmD3p65mDSbHApb7m7qJ16uhG1TnPwa +G3W93pe/XyufUqCFUaR =2/Pj -----END PGP SIGNATURE----- --PGu5HO2wl0WV4hpWIJtfNKSTmDW12Ae5m--