Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77477 invoked from network); 19 Jul 2013 09:30:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2013 09:30:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.51 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.215.51 mail-la0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:36728] helo=mail-la0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/21-05704-C4709E15 for ; Fri, 19 Jul 2013 05:30:53 -0400 Received: by mail-la0-f51.google.com with SMTP id ga9so1535285lab.10 for ; Fri, 19 Jul 2013 02:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Y3FGbjxzYi6t2+yjVwBGCqI8aDIOkiYUyMJiJZ+8wAE=; b=DyCv5jduKAHW+nmw2pd8FSMehkrAbaYhRyuojeV5m7CHYaGubaAYoO647l6vUzLdQ3 t4XcA3HXY3XoHMZxIxOC8TyIrvX2wwJleUAHX+SX12ELKyMOIwZ3hgvZuMGo2ksCwGku VY4+A7avmA8lUOnP4x9DvWCPsP1/nEjkgHepkQd/s22KgqqrgjBEdN5RzXWvf7m+hmG5 p2gF32fmaSzMvUCygE8CX2Sx9yy/D0ORrS+vVEHKEYklWgNopBhrL2PkLOypebVaH3Ns IKrcdychcwCZDa2GAiGlwfahvS1KfucpPOVco6M9YoABstXgmxH3o0vD8CE6F1nKq9Jh j0kQ== X-Received: by 10.112.167.136 with SMTP id zo8mr6945369lbb.33.1374226249946; Fri, 19 Jul 2013 02:30:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.83.4 with HTTP; Fri, 19 Jul 2013 02:30:29 -0700 (PDT) In-Reply-To: References: <-6008161650538629327@unknownmsgid> Date: Fri, 19 Jul 2013 17:30:29 +0800 Message-ID: To: Dan Cryer Cc: Yasuo Ohgaki , Peter Lind , Mateusz Kocielski , Chris London , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c2a4a8781a8504e1d9fbf8 Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: laruence@gmail.com (Xinchen Hui) --001a11c2a4a8781a8504e1d9fbf8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Jul 19, 2013 at 5:18 PM, Dan Cryer wrote: > What's the intended use case for string increment / decrement? > + 1 could we please stop wasting time on such issues? many thanks > It just seems like madness to me, using mathematical operators with > strings, producing seemingly arbitrary results in some circumstances (C -= > > B -> A -> NULL / False ?). > > Also what happens in other languages? Take for example German, in which = =C3=9F > comes after S, =C3=9C after U, and so on. > > > On Fri, Jul 19, 2013 at 9:59 AM, Yasuo Ohgaki wrote: > >> Hi, >> >> I take a look at the code. >> It does support [0-9] also. >> >> [yohgaki@dev tests]$ php -r "\$a =3D ' a10';for (\$i=3D0; \$i<10;\$i++) >> var_dump(++\$a);" >> string(4) " a11" >> string(4) " a12" >> string(4) " a13" >> string(4) " a14" >> string(4) " a15" >> string(4) " a16" >> string(4) " a17" >> string(4) " a18" >> string(4) " a19" >> string(4) " a20" >> >> It sounds good to have string decrements. >> >> >> 2013/7/19 Peter Lind >> >> > Interesting to note that although Perl 6 is apparently capable of >> > decrementing strings, it doesn't fully mirror the incrementing: >> > >> > http://feather.perl6.nl/syn/S03.html#line_516 >> > >> > Specifically: decrementing 'AAA' would not turn into 'ZZ' but would >> error, >> > according to that link >> > >> >> Carry handle of decrements is more complex than increments. >> It may be the reason. >> >> Regards, >> >> -- >> Yasuo Ohgaki >> yohgaki@ohgaki.net >> > > > > -- > > *Dan Cryer* > > 07590 698944 > dan@dancryer.com > +Dan > @dancryer > --=20 =E6=83=A0=E6=96=B0=E5=AE=B8 laruence Senior PHP Engineer http://www.laruence.com --001a11c2a4a8781a8504e1d9fbf8--