Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68166 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70283 invoked from network); 18 Jul 2013 19:10:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2013 19:10:17 -0000 Authentication-Results: pb1.pair.com header.from=me@chrislondon.co; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@chrislondon.co; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain chrislondon.co does not designate 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: me@chrislondon.co X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:57517] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/FC-20914-59D38E15 for ; Thu, 18 Jul 2013 15:10:16 -0400 Received: by mail-we0-f176.google.com with SMTP id t56so3204802wes.21 for ; Thu, 18 Jul 2013 12:10:10 -0700 (PDT) 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=qfpfw+1B2RI+Vv2wBhYTb04klMipckNaSTUG5r2ohDs=; b=MAwOZXZ5vHyayyPbnJ2bexI4iinBEgeWchfK9TnNzD+d2YUosFldxvWv0Sb7yOJtny sj+E79yZjTMroUTCN4L+n74fUpcXJPdkDbOqbbGvWed61CqlNSYgfVciQD/VhKbz/pe0 rdIuZMs81xT3Ha55sgA/m2BbDnGEwaw0ufdDbVF1P8vRmKs5DK5N8y1Q+dQdX0riv9IT wb7nJlGnQtmjsb/hW/Kr/TVgV7ayCBbtkeaGwaEZG2Ut5BiXSsMuxpWMspQdUGuSBl67 yrno/gZQrkFtnbgjrahJCGzUHPAMvh0l0Ck84JHmXv1n5FK6wHCUmqMVBgdbA0fso9fO urZw== MIME-Version: 1.0 X-Received: by 10.180.38.45 with SMTP id d13mr9058536wik.62.1374174610593; Thu, 18 Jul 2013 12:10:10 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Thu, 18 Jul 2013 12:10:10 -0700 (PDT) X-Originating-IP: [66.219.207.210] In-Reply-To: <13538DBB-9602-49C6-A212-661FF5DDAD5F@rtin.so> References: <-6008161650538629327@unknownmsgid> <13538DBB-9602-49C6-A212-661FF5DDAD5F@rtin.so> Date: Thu, 18 Jul 2013 13:10:10 -0600 Message-ID: To: Martin Amps Cc: Xinchen Hui , Mateusz Kocielski , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8f6470038628a704e1cdf56b X-Gm-Message-State: ALoCoQnPXAKDTpFxd7loTOKEFE6DxExarnloiJ9G7+s/wPLdeiBSSJDF8+5rQmeFXt/WJ03NB9T4 Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: me@chrislondon.co (Chris London) --e89a8f6470038628a704e1cdf56b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Something I learned today is incrementing 'Z' goes to 'AA' but that helps the point that it could use more work/clarification On Thu, Jul 18, 2013 at 1:08 PM, Martin Amps wrote: > One hiccup. I imagine maybe the reason we don't support decrementing is > because what would happen if you tried to decrement 'A'. In that case I > would suggest either returning NULL or throwing a notice. > > > It would make sense to make it stay as =E2=80=98A=E2=80=99 like increment= ing =E2=80=98Z' stays as > =E2=80=98Z=E2=80=99. > > I do agree that string manipulation with arithmetic operators needs > work/clarification. > > On Jul 18, 2013, at 7:37 AM, Xinchen Hui wrote: > > =E5=9C=A8 2013-7-18=EF=BC=8C22:31=EF=BC=8CMateusz Kocielski =E5=86=99=E9=81=93=EF=BC=9A > > It seems logical that if we support increment we should support decrement= . > > > My proposal: > > > 1) Support decrementing letters > > - or - > > 2) Throw a notice explaining that decrementing is not supported so > > developers quickly know they can't do that > > > One hiccup. I imagine maybe the reason we don't support decrementing is > > because what would happen if you tried to decrement 'A'. In that case I > > would suggest either returning NULL or throwing a notice. > > > Thanks for the input > > > Chris London > > > Hello, > > Does anybody understand the rules behind the string incrementation? What'= s > the explanation of following behaviour? > > '$x=3D"ZZ";$x++;var_dump($x);' returns string(3) "AAA" > '$x=3D" ZZ";$x++;var_dump($x);' returns string(3) " AA" > > see http://www.php.net/manual/en/language.operators.increment.php > > thanks > > Regards, > Mateusz Kocielski > > > --e89a8f6470038628a704e1cdf56b--