Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68165 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66538 invoked from network); 18 Jul 2013 19:06:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2013 19:06:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=php_m@rtin.so; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php_m@rtin.so; sender-id=unknown Received-SPF: error (pb1.pair.com: domain rtin.so from 209.85.220.46 cause and error) X-PHP-List-Original-Sender: php_m@rtin.so X-Host-Fingerprint: 209.85.220.46 mail-pa0-f46.google.com Received: from [209.85.220.46] ([209.85.220.46:46497] helo=mail-pa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/1C-20914-7CC38E15 for ; Thu, 18 Jul 2013 15:06:48 -0400 Received: by mail-pa0-f46.google.com with SMTP id fa11so3576462pad.33 for ; Thu, 18 Jul 2013 12:06:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to:x-mailer:x-gm-message-state; bh=CaA7TqEh9CZJoBK5DXi/i9zGI5g27dpcAEuL/QXmwzE=; b=I+JceLO3GQ7h2e7KiJhzssBVzAmv5MtR2XIOkrIsUdJkIGW51y7bstJZBfFgIl1wuF sjRxSNm5D5lLjCnyDhtCUQv2lLIqrr/c4DXnmSMItVv7HEC+UfQAkRJCPp87muuRs3M7 9K9NKwNp/UP/eWTTiXpb6YsSYR5FUtMMq1eu5ufIfppLFmEmu9haP1QTsWVo4Xf58k9k 6HK693CO6CNeXkV7Xt98P8u2FesyFu/ypT6wJAUQ9MIbVeTsQVTZDWzjl0dRAShxAlBK JLNDuFkS7yA3ndh4k27OB4oVn33eYCcW9XlIL2qyUpSSos6WKlvt2RdMNO3Vje2Cl1uK KJ+A== X-Received: by 10.68.171.35 with SMTP id ar3mr13410996pbc.61.1374174404144; Thu, 18 Jul 2013 12:06:44 -0700 (PDT) Received: from [10.0.1.46] (64-71-16-94.static.wiline.com. [64.71.16.94]) by mx.google.com with ESMTPSA id nm10sm15184800pbc.28.2013.07.18.12.06.42 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Jul 2013 12:06:43 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_91D10309-4E6C-4454-A90D-4A69ABE21652" Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1784.1\)) In-Reply-To: <-6008161650538629327@unknownmsgid> Date: Thu, 18 Jul 2013 12:08:56 -0700 Cc: Mateusz Kocielski , Chris London , internals@lists.php.net Message-ID: <13538DBB-9602-49C6-A212-661FF5DDAD5F@rtin.so> References: <-6008161650538629327@unknownmsgid> To: Xinchen Hui X-Mailer: Apple Mail (2.1784.1) X-Gm-Message-State: ALoCoQkJXqiJmStE/It6Wj3nkmGlXHB9yC6PIMIc0u8ZAQxX60OHa0Vl2qr4n11gzZT4YcJBbHNe Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: php_m@rtin.so (Martin Amps) --Apple-Mail=_91D10309-4E6C-4454-A90D-4A69ABE21652 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 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 = incrementing =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 >=20 > It seems logical that if we support increment we should support = decrement. >=20 >=20 > My proposal: >=20 >=20 > 1) Support decrementing letters >=20 > - or - >=20 > 2) Throw a notice explaining that decrementing is not supported so >=20 > developers quickly know they can't do that >=20 >=20 > One hiccup. I imagine maybe the reason we don't support decrementing = is >=20 > because what would happen if you tried to decrement 'A'. In that case = I >=20 > would suggest either returning NULL or throwing a notice. >=20 >=20 > Thanks for the input >=20 >=20 > Chris London >=20 >=20 > Hello, >=20 > Does anybody understand the rules behind the string incrementation? = What's > the explanation of following behaviour? >=20 > '$x=3D"ZZ";$x++;var_dump($x);' returns string(3) "AAA" > '$x=3D" ZZ";$x++;var_dump($x);' returns string(3) " AA" >=20 > see http://www.php.net/manual/en/language.operators.increment.php >=20 > thanks >=20 > Regards, > Mateusz Kocielski --Apple-Mail=_91D10309-4E6C-4454-A90D-4A69ABE21652--