Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100354 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90452 invoked from network); 2 Sep 2017 12:26:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2017 12:26:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 104.47.36.98 cause and error) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 104.47.36.98 mail-sn1nam02on0098.outbound.protection.outlook.com Received: from [104.47.36.98] ([104.47.36.98:61888] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/D1-04538-E63AAA95 for ; Sat, 02 Sep 2017 08:26:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0oj8SurEubMpSaPbSnbL8ltGEefwr4/QUQgcQO/ntBY=; b=dyIdXO3enNgJK7n9qyg28AVeXsYSrDNOrAxpNb8BS/1H4xsFkVWwsILQnV5Z3vDrrrZ/KeJFwURyMLTy2TByOdvnedMSSrDFk2JyxohYpLiDOW3Sd8TqIAqhvUlao3qnv6mtYloSyDaD9QK+YHYv6Yp8kuQ1vp4AXux3T1Vl2I8= Received: from BY2PR02MB298.namprd02.prod.outlook.com (10.141.140.21) by BY2PR02MB1623.namprd02.prod.outlook.com (10.163.26.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Sat, 2 Sep 2017 12:26:11 +0000 Received: from BY2PR02MB298.namprd02.prod.outlook.com ([10.141.140.21]) by BY2PR02MB298.namprd02.prod.outlook.com ([10.141.140.21]) with mapi id 15.20.0013.015; Sat, 2 Sep 2017 12:26:11 +0000 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] [VOTE] UUID Thread-Index: AQHTI7l6xf5xAadSwkqa7tWDxIIW46KhW7VAgAANYICAABzKRQ== Date: Sat, 2 Sep 2017 12:26:11 +0000 Message-ID: <76EE812B-922D-46B4-8525-6AFA75843816@zend.com> References: ,<9f09589f-0a8e-1b8c-7b4c-b7d6899ed4ab@fleshgrinder.com> In-Reply-To: <9f09589f-0a8e-1b8c-7b4c-b7d6899ed4ab@fleshgrinder.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=zeev@zend.com; x-originating-ip: [2.53.33.39] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY2PR02MB1623;6:JZynxlZxZIRI1H+xrj0Um06mnaWF2krUIWX+hEwVQ2hJULyvOWJ7ZxO4yA5q2QGlcPIJh6Su0G8OVOA7ry61jxkNHmCWBoGdN6ViCOT3p9i71l7Qv1svtwP/mAYtgCWeFGcn+X9bdPOVjDagsdLMtjRtUJtYnl/MKWj8wViZ0VmdalvEzmBQhspGuRLr+XBo8aXf2OqwMtZgFAMWwqW3AW8pzugOl8cNJGzgbJVLgFxpm3cWU74CBDNTzyXxzyg+ycAn42d/a78SMscpTtCMqBQd83bwEOUVne9q2G6UD0N279tNTbM8DP8kq8CIxxey6L57S8lLg+ak/ntrTeFlKw==;5:U0mfEt9JNQBWxkBxeb4gLjJjk3Mxn/ZlPkDHLWw2fe+8u5bLCEmM2Xeuj/9+LcBJi2Q+kgM/rlB13UNRT3zlGOnoyTzY8oQmT6h86LGqqmB4RUMPVQGjX+D0ui5t49cjSeLGD2VzNcJLArHN1t8XiA==;24:eTmROYgUBMAlQyMpzHdweNaaFH1QRUKsOgE2WKhPmnbK8Her6sA4fdFJvbk9PZVJ+ycxhfoKgmUnQ4ltaWvTpNoV3+lpfPVk7v3sfCnZHXM=;7:+SIFmr3UsatLzg/jPDq9+NHMMofCFfviJjQktLI2QWav7tnQ0x37JLPWz4kOpNUrkXlIAlnC14z2x7FmFEjpXNQ254IbZr6cdkANRbHGzcKRb2uIazsP9t0lLc2KvoYgNQ+8NaER4bBQ7QkEtIDLnLQa9sl9NPyQXxV8W/ENGww2mQ36o5RxvoW2enWDhz03DFFs1Ai6KJwUioN55+Wl/M1ALcaM29DGZQSfd4sosbo= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: e20f9dd0-20de-404f-9904-08d4f1fdcbc7 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR02MB1623; x-ms-traffictypediagnostic: BY2PR02MB1623: x-exchange-antispam-report-test: UriScan:(148322886591682); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR02MB1623;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR02MB1623; x-forefront-prvs: 04180B6720 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39830400002)(51444003)(24454002)(377454003)(189002)(199003)(6116002)(229853002)(102836003)(6486002)(3846002)(86362001)(2950100002)(478600001)(6506006)(6916009)(2501003)(305945005)(97736004)(68736007)(53936002)(7736002)(33656002)(8936002)(77096006)(6246003)(81156014)(189998001)(83716003)(6436002)(81166006)(53546010)(110136004)(6512007)(1730700003)(8676002)(2351001)(2906002)(106356001)(82746002)(50986999)(105586002)(5660300001)(54356999)(99286003)(36756003)(76176999)(66066001)(2900100001)(25786009)(101416001)(14454004)(3660700001)(3280700002)(5640700003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR02MB1623;H:BY2PR02MB298.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2017 12:26:11.1614 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1623 Subject: Re: [PHP-DEV] [VOTE] UUID From: zeev@zend.com (Zeev Suraski) > On 2 Sep 2017, at 13:43, Fleshgrinder wrote: > 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 be= tter than uniqid() built into the language. >> 1. I think a renewed discussion, beyond the two days of discussion 3+ mo= nths ago would be useful, as beyond that basic (yet important) point - I ha= ve thoughts about a bunch of things in the RFC, and honestly didn't even no= tice the brief discussion months ago (if there was another one then my apol= ogies, I couldn't find it). >=20 > 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. As far as I'm concerned the only relevant discussion is on internals. It's= ok to use other mediums (although personally I think it's not very positiv= e) - as long as they're ultimately represented on internals. My quick search suggested there was only roughly two days worth of discussi= on sometime in May, but it's possible I wasn't thorough in searching. >=20 >> 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/obje= cts in such a case - where there's little to no added value, is wrong and u= ncommon (possibly unprecedented) in PHP. >=20 > DateTime? SPL? Intl? Not really - all of those give substantial value that can't really be provi= ded without a class. Not so with UUID - I'm quite with Nikita when he says= that 95% of the value can be had with a single function call - it's theref= ore not a good candidate for mandatory object wrapping. >=20 >> 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, whic= h might collide with user defined classes of the same name in the global na= mespace. 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 userb= ase. 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 mi= ght 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 in= troducing - at least the UUID class - is very low. Not that I have a bette= r suggestion (other than not introducing a class at all) - but I think the = text there should be changed as it does not reflect reality. >=20 > 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. Rightfully so - I don't think a UUID namespace is the answer as it's an ove= rkill. But UUID isn't just a global class name - it's actually a global cl= ass name that's not that unlikely to exist in apps and collide with them (a= s opposed to, say, UUIDParseException). At minimum the comment about the r= isk being very low, as well as the personal preference not to have user cla= sses in the global namespace should be removed, imho, even if we can't come= up with a better name. It may be that sticking with the UUID class name i= s the right choice (if we pick the wrong choice of introducing a class and = not a function :-) but we should be accurate and upfront as to why we think= it's ok. >=20 >=20 >> 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 absolute= ly matters. If we manage to get JIT out the door and the performance diffe= rences become negligible - then I see a lot of value in moving some of our = core value to PHP - but not before then. >=20 > I would agree, but most people think differently. The wording is a > result of the discussions. Where's the poll / vote that most people think differently? Either way, even if it can be argued that for this particular case performa= nce is a weak argument (which is debatable), it's most certainly not an inh= erently weak argument as the current wording implies. There shouldn't be a= ratified PHP RFC implying that performance considerations are weak argumen= ts, without clear context and explanation. >=20 >> On 9/2/2017 12:14 PM, Zeev Suraski wrote: >> 5. Given we seem to agree this is a basic building block of the languag= e (as it is in other languages), I do think it should be a 2/3 majority vot= e 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'. >=20 > 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. Regardless of being final, they'll become a basic building block in apps, a= nd taking them away or modifying them means substantial breakage. The very= introduction of the class, its name (and to a lesser degree its functional= ity) - are tickets with remarkably expensive cancelation options. Zeev