Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68192 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84321 invoked from network); 19 Jul 2013 10:35:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2013 10:35:25 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:40329] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/E0-13120-B6619E15 for ; Fri, 19 Jul 2013 06:35:24 -0400 Received: by mail-lb0-f178.google.com with SMTP id y6so3308428lbh.9 for ; Fri, 19 Jul 2013 03:35:20 -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:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=g6Ps1st9sdytPzEGetQmycsWYmiXGf8LjHWSwCyPSDI=; b=sEFK+ycCDNdNQ8ZXwRpd+KIwbyEKrMPdn2u6gqnfEacRf/kXlFG2XJuOr+EpPrmdPp aPsDb+UPqjV/6R4HvpB4Rt0XYo4xHeyIBMNjdBmRm8D+OyOPg971GyKAYH/7Atz4QRkH +d++9qEBDiMKcnsDjc25G3JSX+3dy2xuGhNvrjf5Ctg4sjWyLbF2K11+20ocZZZ9mP+P 6UDoW1B9jED6tpZMtx2fYI5fxq1spsRwBocsd/VFxTPsem/krYdaAZW4DXftnQydHcEM JReTmfT71gz5KE8WoMZmJtAQTD73d70cHJOzV4ORHytSFbTvPb1jXI+Os6cgHHRzgTmD hxjA== X-Received: by 10.112.205.163 with SMTP id lh3mr7162252lbc.45.1374230120767; Fri, 19 Jul 2013 03:35:20 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.4.233 with HTTP; Fri, 19 Jul 2013 03:34:40 -0700 (PDT) In-Reply-To: References: <-6008161650538629327@unknownmsgid> Date: Fri, 19 Jul 2013 19:34:40 +0900 X-Google-Sender-Auth: TFsnDgssNZUyXVIVjQsMJ-16nAM Message-ID: To: Peter Lind Cc: Dan Cryer , Mateusz Kocielski , Xinchen Hui , Chris London , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c315983025a204e1dae21f Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c315983025a204e1dae21f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, 2013/7/19 Peter Lind > On 19 July 2013 11:18, Dan Cryer wrote: > >> What's the intended use case for string increment / decrement? >> >> > Personally, I instantly think of mirroring spreadsheet columns - works > quite well in that context. > ++/-- 'XYZ00001234' would have use cases. > > >> It just seems like madness to me, using mathematical operators with >> strings, producing seemingly arbitrary results in some circumstances (C = -> >> B -> A -> NULL / False ?). >> >> > Throw a warning and don't decrement A/a any further - that's not arbitrar= y. > -- is more problematic. --'XYZ0000' would be 'XYZ0000' or 'XYY00000' or 'XYY'? It would be better not to change length of string, IMO. e.g. --'XYZ0000' became 'XYY0000' All chars would stop decrement at lowest chars of [0-9], [a-z], [A-Z]. e.g. Lowest value of 'XYZ0000' is 'AAA0000'. This is not a symmetric operation of ++, but it's impossible to achieve symmetric operation ++/-- on strings anyway. > >> Also what happens in other languages? Take for example German, in which = =DF >> comes after S, =DC after U, and so on. >> >> > Nothing, works purely on ascii, as is currently the case. Perl handles > other character sets though - see the link I posted for details on how. > There may be need for this, but it will be very complex code than now. [0-9a-zA-Z] would be enough. PHP doesn't have default multibyte char module, too. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c315983025a204e1dae21f--