Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70666 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95168 invoked from network); 16 Dec 2013 18:26:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2013 18:26:37 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:45898] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/AA-32483-5D54FA25 for ; Mon, 16 Dec 2013 13:26:36 -0500 Received: by mail-wi0-f182.google.com with SMTP id en1so2553925wid.9 for ; Mon, 16 Dec 2013 10:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=S04XsieYFD5MdAC4v+me2mCd7KkWgHLZEBqZwg547os=; b=pYayrGshstp7FtHYqZ2g2qvA24+IrxbXpBO5fuOi4p3tBUj72fp8HzvOtySrVjExOJ DpMsWjZBEvAs3JB7ibdn4OXTPR7T0Kyihhbunn5yLISeTAiFEW+3gM2H3obIb0jLC5gG 0F2F4euc9DLNo9Kw12lbu+r2jueHxAeHDe5ecRftqedfAf/RbM77KF2/XyeRJzRU2oZ3 naQFhpujVeT4WjfsqWN+b1pHj8Qk71s1cYHqNkkn6JaIuGF3RXY5gJ1HaurvMbs0E1pY EaNgD5xdj4IxOoFs0WTt5Wp4kWvBdL8Q5sWTJhx0Fx1DonFlDF+bxQIiKlVl2Mj03KJu hPJw== X-Received: by 10.180.171.34 with SMTP id ar2mr15101621wic.25.1387218382273; Mon, 16 Dec 2013 10:26:22 -0800 (PST) Received: from [192.168.0.146] ([62.189.198.114]) by mx.google.com with ESMTPSA id z2sm9949539wiy.11.2013.12.16.10.26.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 10:26:21 -0800 (PST) Message-ID: <52AF45CC.10604@gmail.com> Date: Mon, 16 Dec 2013 18:26:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <52AA1649.2090601@ajf.me> <52AAA1EA.7030106@marc-bennewitz.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PROPOSAL] Alphanumeric decrement From: rowan.collins@gmail.com (Rowan Collins) 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. Regards, -- Rowan Collins [IMSoP]