Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71657 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50147 invoked from network); 28 Jan 2014 02:52:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jan 2014 02:52:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.172 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:57957] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/B7-01140-35B17E25 for ; Mon, 27 Jan 2014 21:52:04 -0500 Received: by mail-lb0-f172.google.com with SMTP id c11so5185980lbj.3 for ; Mon, 27 Jan 2014 18:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=f8dRDQjk1HH2PahVILdSh5FFpptc6oh7i0KiCl6GYlY=; b=dyl0NOMQN0B9w22dtsmPhN4BtnMiZ/QUJDOsuQqcX28HndOI5kKO+FN83W/f5L6avk AblhATgCV+16hjv5NzeQpC6ZbTF7L4wbccy0xoSEsHIy7ExfO+YwEV8WgcazBR/uY03j U1g0jtPJBg0uH+fyBpt8tcIfePk61cRnHskMTjDAK0p5IImIa44Il5rXesGXwdQgN0sX q5xUv9dkn0kjN++aV4q53Cy68uo10xdN0RaHz6Ht6hX8rWDdU3u5cfkqSF/jcBgsBmaG piUCgYGkyZGYUaECw6S0cMyOXfTS45kUGmaa9p0j6uVY0VKaL2QTB56imq+Gp0yrdd2F ZJgA== X-Received: by 10.112.88.233 with SMTP id bj9mr2356076lbb.10.1390877520825; Mon, 27 Jan 2014 18:52:00 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Mon, 27 Jan 2014 18:51:20 -0800 (PST) In-Reply-To: References: <52DDBAE5.2010803@ajf.me> <52E6FD70.4010005@ajf.me> <52E70943.3010700@ajf.me> Date: Tue, 28 Jan 2014 11:51:20 +0900 X-Google-Sender-Auth: 31AeqMlC9rXtApH0rGJVurWQWUQ Message-ID: To: Tjerk Meesters Cc: Andrea Faulds , PHP internals Content-Type: multipart/alternative; boundary=001a11c36ad48e118b04f0fee8e7 Subject: Re: [PHP-DEV] Re: [VOTE] [RFC] Alphanumeric Decrement From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c36ad48e118b04f0fee8e7 Content-Type: text/plain; charset=UTF-8 Hi Tjerk, On Tue, Jan 28, 2014 at 10:39 AM, Tjerk Meesters wrote: > I still have an RFC lying around that suggests this, together with some > other changes to how increment / decrement works. Perhaps we could flesh > this out further? > > https://wiki.php.net/rfc/normalize_inc_dec > The following behaviour is proposed: // booleans $a = false; ++$a; // bool(true) $a = true; --$a; // bool(false) // null values $a = null; --$a; // null $a = null; ++$a; // null // empty strings $a = ''; ++$a; // int(1) // non-numeric strings $a = '12d9'; ++$a; // string(4) "12e0" + Notice: String increment is deprecated, use str_inc() instead in php shell code on line 1 ++$a; // float(13) +1 especially boolean++/--. It's great for flip flop. I guess most users use int++ and int%2 for flip flop currently. Existing scripts using ++/-- against bool would be a bug most likely. Other proposal sounds reasonable to me, too. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c36ad48e118b04f0fee8e7--