Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47386 invoked from network); 18 Jul 2013 14:42:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2013 14:42:42 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.41 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.215.41 mail-la0-f41.google.com Received: from [209.85.215.41] ([209.85.215.41:57377] helo=mail-la0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/B8-20914-1EEF7E15 for ; Thu, 18 Jul 2013 10:42:42 -0400 Received: by mail-la0-f41.google.com with SMTP id fn20so2611385lab.28 for ; Thu, 18 Jul 2013 07:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:mime-version:in-reply-to:date:message-id:subject:to :cc:content-type; bh=egDFw7yoQecJn2E67Ljt329Frwjw899zOY+PPRAl5uU=; b=iKDnPc+Zrd46el70NV7gZsDyMPif2zO6phw4LupbwvbsWENnF6aWZMKaBt+e+R9wZh G8RL039EXbHKtBHrSqonxX9ZuzvHer/dIVO++qvSFnnW6HBmrJ7atHIHlqTtvtOP0ACq WztkRsmcR2Pv41qBeC1IneIYud3ZlOz3/TV7nQOQF+jbqcaY0Z58z+L9XLdpKCQsBMCA X2s5VTYCwIvFAB++gLIZm1oY6ghxgCNqM7ldDR+YTV7K+Md4yAHFwSLGUluTAb6ZMlQK pq0f/dNdjXW/K/az1j9ncx17g85/zoY5QP7srK7uGZlEvGo7lXznW/KHHtn0ieUclUtt 1AaQ== X-Received: by 10.152.29.227 with SMTP id n3mr5408628lah.43.1374158558129; Thu, 18 Jul 2013 07:42:38 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Date: Thu, 18 Jul 2013 22:37:49 +0800 Message-ID: <-6008161650538629327@unknownmsgid> To: Mateusz Kocielski Cc: Chris London , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0158c76cb8f2de04e1ca3869 Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: laruence@gmail.com (Xinchen Hui) --089e0158c76cb8f2de04e1ca3869 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E5=9C=A8 2013-7-18=EF=BC=8C22:31=EF=BC=8CMateusz Kocielski =E5=86=99=E9=81=93=EF=BC=9A It seems logical that if we support increment we should support decrement. My proposal: 1) Support decrementing letters - or - 2) Throw a notice explaining that decrementing is not supported so developers quickly know they can't do that 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. Thanks for the input Chris London Hello, Does anybody understand the rules behind the string incrementation? What's the explanation of following behaviour? '$x=3D"ZZ";$x++;var_dump($x);' returns string(3) "AAA" '$x=3D" ZZ";$x++;var_dump($x);' returns string(3) " AA" see http://www.php.net/manual/en/language.operators.increment.php thanks Regards, Mateusz Kocielski --089e0158c76cb8f2de04e1ca3869--