Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68188 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74147 invoked from network); 19 Jul 2013 09:18:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2013 09:18:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=dan@dancryer.com; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dan@dancryer.com; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain dancryer.com does not designate 209.85.214.178 as permitted sender) X-PHP-List-Original-Sender: dan@dancryer.com X-Host-Fingerprint: 209.85.214.178 mail-ob0-f178.google.com Received: from [209.85.214.178] ([209.85.214.178:56055] helo=mail-ob0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/70-05704-27409E15 for ; Fri, 19 Jul 2013 05:18:43 -0400 Received: by mail-ob0-f178.google.com with SMTP id fb19so4990580obc.37 for ; Fri, 19 Jul 2013 02:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dancryer.com; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=jn7wIiIyGKhYZ69ww2OFo1hsACXbC/JYLCRFbIWPRoI=; b=KEZkUIfABhK8Kr0l8uAAfbeQLvlONWnw/KVZ8YNetWOOzBQBFpKRlbyem8XAWXwVc1 15EtOXQfQfaAkffgh8z6VdschnZtxA7MpFf09sjNEe9gXkT6Fhwvm6CfUBlOUsJXHgYB qmT92nnYtxldQ717dlHsOcW88di+jC/Qigu58= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=jn7wIiIyGKhYZ69ww2OFo1hsACXbC/JYLCRFbIWPRoI=; b=cwL3NCGra3AEaSxEgrsX+Borbwa0Cam2fGJtTokgOSQJISon92tV4yHy6ZFLe9XYzJ r2X6/FI8iRw0jVGpqjh5XPxvdl2G20dB9gXgf9SU1i7oq2dS0EPmEKMqtnI55hNngk+o jQNXtfIZ8b1rXv2pWJzhdtvSpNchuGEuuNivTMWe2lRuyYo+YpNu4T45EPrXJvwOXd8B eQeDQvdm+/+KNrGsD1gvYvYH9MjPd/20nN/jBLwMplv8Fl8lu3rCZZtaIXly5yS7ffTt vUnCYhrZWFBR7beUIJHY/STuM2k/ub5iBZj8Ta6lF47Mai9g2nOS/p4KMnuIlAEH7Y12 WxVg== MIME-Version: 1.0 X-Received: by 10.182.241.71 with SMTP id wg7mr11435901obc.50.1374225519332; Fri, 19 Jul 2013 02:18:39 -0700 (PDT) Received: by 10.60.6.232 with HTTP; Fri, 19 Jul 2013 02:18:39 -0700 (PDT) X-Originating-IP: [213.104.14.230] In-Reply-To: References: <-6008161650538629327@unknownmsgid> Date: Fri, 19 Jul 2013 10:18:39 +0100 Message-ID: To: Yasuo Ohgaki Cc: Peter Lind , Mateusz Kocielski , Xinchen Hui , Chris London , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c2e0f0ebdcce04e1d9cfb4 X-Gm-Message-State: ALoCoQkPeZ4E/ygDrWZ5F6ggIFNNgRi3mtrhTicaMointagBd9DGz8bLHC+bScoT6b27vYpjWZlS Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: dan@dancryer.com (Dan Cryer) --001a11c2e0f0ebdcce04e1d9cfb4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What's the intended use case for string increment / decrement? 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 =DF comes after S, =DC 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 > --=20 *Dan Cryer* 07590 698944 dan@dancryer.com +Dan @dancryer --001a11c2e0f0ebdcce04e1d9cfb4--