Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70684 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38316 invoked from network); 16 Dec 2013 23:33:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2013 23:33:21 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.182 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.128.182 mail-ve0-f182.google.com Received: from [209.85.128.182] ([209.85.128.182:52976] helo=mail-ve0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/D2-32483-FBD8FA25 for ; Mon, 16 Dec 2013 18:33:20 -0500 Received: by mail-ve0-f182.google.com with SMTP id jy13so3906844veb.27 for ; Mon, 16 Dec 2013 15:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lFzINr5BbeChjUvDgwFDuX+GqW6Y8ypL7XQZGkjcAWo=; b=YlfGUGbUjYehZjVZ54H4ueR65E/7DBbX06MYw1BZzRAuAICYAROML1lHPHqnvd6/z9 NgkzM7rcpWLYcOXjB/Jol3vHwa/aBEoddYY4625mpI4+ijAyyL9IwyBPXBzDa9U52jGm azqPzS7MLAADNQLsfyAi5q2FeuoXDyqOpqG0p3Sqfy9jorOWsPw6q4rJOor/+wxyvUzf 6wmo26X5Lry00FP+/3MKeEsLA6dx5zr40mYnyuvRsxsd9c0FcGqXywfLOpcnE7+bTziB ++v7H4pZXqdn//sHooa9I/Mw1wS+nnWhTIjb54QzljY+UVU/wAxFtneDIdiE9sTpRdVb fNqQ== MIME-Version: 1.0 X-Received: by 10.220.86.69 with SMTP id r5mr9586009vcl.9.1387236796824; Mon, 16 Dec 2013 15:33:16 -0800 (PST) Received: by 10.58.128.33 with HTTP; Mon, 16 Dec 2013 15:33:16 -0800 (PST) In-Reply-To: <52AF45CC.10604@gmail.com> References: <52AA1649.2090601@ajf.me> <52AAA1EA.7030106@marc-bennewitz.de> <52AF45CC.10604@gmail.com> Date: Tue, 17 Dec 2013 07:33:16 +0800 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c1ff447e843304edaf3c90 Subject: Re: [PHP-DEV] [PROPOSAL] Alphanumeric decrement From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a11c1ff447e843304edaf3c90 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 17, 2013 at 2:26 AM, Rowan Collins wrote: > Tjerk Meesters wrote (on 13/12/2013): > >> Basically it makes the `$x++` or `++$x` work as if you types `$x += 1` or >> `$x = $x + 1` (except for arrays, currently) >> ++null becomes int(1), --null becomes int(-1) >> > > Yes please! One of my colleagues once raised a bug that currently > incrementing null results in 1, but decrementing it results in it remaining > null. On the other hand, `null -= 1` results in -1 as you would expect. > > The bug was closed as invalid, stating that this is documented behaviour, > but I have never understood why this would be anything other than an > accidental side effect of implementation, nor why you would ever rely on it. > > > ++"123a" becomes "123b" but with a notice that string increment is >> deprecated >> > > Lukewarm on this part; the current syntax seems fairly logical to me, and > the proposed new functions more ugly for no very good reason. > I would love to completely eradicate it, but I also realize that there's existing code using it, such as: for ($class = 'A1'; $class <= 'A4'; ++$class); It might be hard to find the places where such code is being used, so I figured it made sense to have a deprecation period instead. > > Regards, > -- > Rowan Collins > [IMSoP] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -- Tjerk --001a11c1ff447e843304edaf3c90--