Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70610 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59314 invoked from network); 12 Dec 2013 21:32:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2013 21:32:58 -0000 Authentication-Results: pb1.pair.com header.from=php_m@rtin.so; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_m@rtin.so; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain rtin.so from 209.85.192.180 cause and error) X-PHP-List-Original-Sender: php_m@rtin.so X-Host-Fingerprint: 209.85.192.180 mail-pd0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:37225] helo=mail-pd0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/C3-32587-88B2AA25 for ; Thu, 12 Dec 2013 16:32:57 -0500 Received: by mail-pd0-f180.google.com with SMTP id q10so1206079pdj.25 for ; Thu, 12 Dec 2013 13:32:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=6t2sGwlaoXaLztRBSQVQYoqx+C6S7C3AGTR8/xEtgJ0=; b=dW8UlnMKurMzRLvdXNt6AbFanvagRQNJrw8JY4dmj7GrbaZr0tvamyG0ELfjT2UlgQ GT1Kg31ZNSsh9OIRVU07kx8w4hOHJeeW66c0Vp8kXskGiRwbLX20atsOuneeFgX8ULPO VjUfbKT/SkZccKd4jhDjrsvrtyBz4PnOxn/Gj5XB7/4PSWcjTTIy3gigbpwqef7k3AYt 2TvRoKWp6wgenLuH6xou58+5RwF3D6oeBOsFFcJ+zyFKDE9wsCrWDrrWe7BBA1iCIBVv KGM6aexOUw82MfIdTGuRfYnIHFAXruogxXNPO7RjRh9XtoS/afcXDfTERGS+txk3cAFh pj8Q== X-Gm-Message-State: ALoCoQm29uZtIqhgCZY+9lBtlEDjDGR8x1xDjIVtiYbICQ2X5dostuYoJSA0+TxMuSW97RulT38Z X-Received: by 10.68.189.101 with SMTP id gh5mr15985089pbc.39.1386883973894; Thu, 12 Dec 2013 13:32:53 -0800 (PST) Received: from [10.0.1.24] (199-192-87-166.static.wiline.com. [199.192.87.166]) by mx.google.com with ESMTPSA id vn10sm6596976pbc.21.2013.12.12.13.32.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Dec 2013 13:32:52 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_55695E73-0F3D-406E-A923-EA9EB273458A" Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) In-Reply-To: <52AA1D9C.9010306@ajf.me> Date: Thu, 12 Dec 2013 13:32:51 -0800 Cc: Adam Harvey , PHP internals Message-ID: <02678ACF-D1F7-44ED-A750-4D9ABEF6956C@rtin.so> References: <52AA1649.2090601@ajf.me> <52AA1D9C.9010306@ajf.me> To: Andrea Faulds X-Mailer: Apple Mail (2.1822) Subject: Re: [PHP-DEV] [PROPOSAL] Alphanumeric decrement From: php_m@rtin.so (Martin Amps) --Apple-Mail=_55695E73-0F3D-406E-A923-EA9EB273458A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This topic has been discussed before, see = http://marc.info/?l=3Dphp-internals&m=3D137415522724276&w=3D1 for the = thread On Dec 12, 2013, at 12:33 PM, Andrea Faulds wrote: >=20 >=20 > On 12/12/13 20:19, Adam Harvey wrote: >>=20 >> I wonder if we'd want to warn when 'a' decrements to 0, since it's a >> somewhat unintuitive behaviour. (Also, since Perl will decrement 'a' >> to -1 and Perl was the original inspiration, do we want to decrement >> to -1 as well for consistency?) >>=20 >=20 > Ooh, I didn't know about Perl's -1 behaviour. That might be a better = idea, since "z" becoming "aa" suggests that "a" is functions more like 0 = here than 1. That, or the warning you suggest. >=20 > Also, I forgot to mention in my original post, but there is another = thing changed by this patch. At present, when decrementing a string, it = is treated as an integer zero if it is empty. This patch also removes = that check. This brings incrementing into line with decrementing. "" = would increment to "1" and decrement to "-1", while at present it = decrements to -1 (the integer). > --=20 > Andrea Faulds > http://ajf.me/ >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 --Apple-Mail=_55695E73-0F3D-406E-A923-EA9EB273458A--