Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78307 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 516 invoked from network); 24 Oct 2014 14:01:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2014 14:01:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.181 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.181 mail-qc0-f181.google.com Received: from [209.85.216.181] ([209.85.216.181:47685] helo=mail-qc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/50-31309-7CB5A445 for ; Fri, 24 Oct 2014 10:01:44 -0400 Received: by mail-qc0-f181.google.com with SMTP id r5so747085qcx.26 for ; Fri, 24 Oct 2014 07:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=hX6ftmGkwPzlSdN31x0c9nsFGmVPk8JvoGRyYhTQTHs=; b=mre8QNN5hv4x7PP5eF2B/0Sio5nNEgaQLPl698t9ZJFVOCusdpOWJq27vDmTSzvFgr s99wZYdJUCiuH4a6nYAjq36yRA3xrf5IWywQetw9hPSCk5Vhb/sAtqeNZf525RwIlN4I Qi/xPPkA1SUMn8OCOpHjbgWKfyih83G2Prv2KPxIh9ah2W2WRyuCxKuCLdzzAuW0hzlp 8eGANruAQJhTgHpUkxF+AnVO8hRtGjhJ4U7+sBWUzRJsvnGk4+VN7gfaKWahgQosHg4I 3SnWdMNgKGABCSeFbZzp3zM6cWCZGdZYVsl9frfgNrmldu4Lt+yRy1TPdtUui4G3+chJ L5FA== MIME-Version: 1.0 X-Received: by 10.229.97.72 with SMTP id k8mr6347081qcn.16.1414159300947; Fri, 24 Oct 2014 07:01:40 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.140.239.194 with HTTP; Fri, 24 Oct 2014 07:01:40 -0700 (PDT) In-Reply-To: <1414130585.2624.64.camel@localhost.localdomain> References: <1413875212.2624.3.camel@localhost.localdomain> <54469840.3070708@sugarcrm.com> <1414051917.2624.35.camel@localhost.localdomain> <1414060726.2624.60.camel@localhost.localdomain> <1414072403.3228.3.camel@kuechenschabe> <87D717D5-273B-4A32-A3E5-83EBDFD314CB@ajf.me> <1414077690.3228.12.camel@kuechenschabe> <54495CF6.30608@sugarcrm.com> <1414130585.2624.64.camel@localhost.localdomain> Date: Fri, 24 Oct 2014 15:01:40 +0100 X-Google-Sender-Auth: LOuaf-6VftzLX_8YWGC7uks4_4k Message-ID: To: Joe Watkins Cc: Stas Malyshev , =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Andrea Faulds , Dmitry Stogov , Philip Hofstetter , PHP Internals Content-Type: multipart/alternative; boundary=001a11337a40c9fde205062b9e1e Subject: Re: [PHP-DEV] [RFC] UString From: daverandom@php.net (Chris Wright) --001a11337a40c9fde205062b9e1e Content-Type: text/plain; charset=UTF-8 On 24 October 2014 07:03, Joe Watkins wrote: > On Thu, 2014-10-23 at 12:54 -0700, Stas Malyshev wrote: > > Hi! > > > > > P.S. u() is a bad name, will break lots of code, i.e. > > > > Maybe __u()? It's a bit ugly but you're not allowed to use __ so it's > safe. > > > > /me cringes ... > > I wonder how much of a problem it really is, usually when we say some > function name is a problem is because of hundreds and hundreds of > results on github. > > If it's a huge problem then we should rename it, if we have to dig > around for a single project that's incompatible, or even a handful, then > it's not really a problem. > > Cheers > Joe I can see this being something relatively common. While I personally would never do it, there are a few reasons I can think of that people *might* do it: - Wrapper for creating HTML output - urlencode() shortcut - (obviously) various unicode-related things Searching on codesearch [1] revealed (amongst a few other hits on the first page) another interesting use of it in the hhvm test suite [2]. It's difficult to search for this because all the available public search engines that I know of do fuzzy matching. Sorry. This sucks, because every other option we have for this is sucks. On the bright side, anything chosen could always be aliased at the top of the file: use function __u as u; This also sucks, but it sucks a little bit less because the collisions are avoided - or at least, avoided in such a way that the onus is on the user - and one can still have the sane name. First-class support at the syntax level (presumably $foo = u"unicode string" since we already have $foo = b"binary string") would IMO be better and (hopefully?) a long-term goal, but I am aware that it is - and probably should be - outside the scope of the current proposal. [1] https://searchcode.com/?q=function+u+lang%3Aphp [2] https://github.com/facebook/hhvm/blob/master/hphp/test/slow/ext_icu/uspoof.php#L13 --001a11337a40c9fde205062b9e1e--