Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37551 invoked from network); 19 Jul 2013 06:39:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2013 06:39:50 -0000 Authentication-Results: pb1.pair.com header.from=shm@digitalsun.pl; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=shm@digitalsun.pl; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain digitalsun.pl from 209.85.223.169 cause and error) X-PHP-List-Original-Sender: shm@digitalsun.pl X-Host-Fingerprint: 209.85.223.169 mail-ie0-f169.google.com Received: from [209.85.223.169] ([209.85.223.169:58047] helo=mail-ie0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/A6-34315-43FD8E15 for ; Fri, 19 Jul 2013 02:39:49 -0400 Received: by mail-ie0-f169.google.com with SMTP id 10so9022354ied.28 for ; Thu, 18 Jul 2013 23:39:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=DUif9TMrOX/l+dsamY4Gh5msUYoPeypa3CTbbd08bpw=; b=moHbciPbw70HBFVdqcMCjE9a4Ui3BOaBhN07rlpcZMcInjnOIPxHtJ1AZpS6Fnikf7 nRfvbuNk6hfWEe3vPiCx0qvwm7wSMCovMFMCAE4uJ6MbvmEo0Ysqv5qj/1SSZMwG4FEw /kPVbItgPooeRqW6S/BD8DtDAVh1N7kfAv+wSPFzT3RiIangKZqFyqBZV5L+7JjAsARy XcStlspG809yV2yYVCZLqK+iASTUyCmBfg29dweI8mVYQYxt5I2//g8hUVIuWQGE9xbg lPEdSIlxcAa45p2mrHrvyOhD5NevWnrT+Tj3hcXx/VMKtSZ6TMmsMQEf/3zHEqb682hM FBag== MIME-Version: 1.0 X-Received: by 10.43.137.65 with SMTP id in1mr358873icc.103.1374215985694; Thu, 18 Jul 2013 23:39:45 -0700 (PDT) Received: by 10.64.249.202 with HTTP; Thu, 18 Jul 2013 23:39:45 -0700 (PDT) X-Originating-IP: [178.213.221.23] In-Reply-To: <-6008161650538629327@unknownmsgid> References: <-6008161650538629327@unknownmsgid> Date: Fri, 19 Jul 2013 08:39:45 +0200 Message-ID: To: Xinchen Hui Cc: Chris London , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkhinv4HJYnQPSOES27y2/W/Xpq6l9wBFM6WS/BCQi7RefwuM9qi2RekGFWMlzjMUBn/47X Subject: Re: [PHP-DEV] Feature Proposal: Allow letter decrementing From: shm@digitalsun.pl (Mateusz Kocielski) On Thu, Jul 18, 2013 at 4:37 PM, Xinchen Hui wrote: >> Hello, >> >> Does anybody understand the rules behind the string incrementation? What's >> the explanation of following behaviour? >> >> '$x="ZZ";$x++;var_dump($x);' returns string(3) "AAA" >> '$x=" ZZ";$x++;var_dump($x);' returns string(3) " AA" >> > > see http://www.php.net/manual/en/language.operators.increment.php I don't see any explanation for the examples above. Documentation says: [...] For example, in PHP and Perl $a = 'Z'; $a++; turns $a into 'AA' [...] I'd expect " ZZ" to become " AAA" rather than " AA". I'm not sure if it's a bug in documentation, in code. Probably nobody can even distinguish if it's a bug or feature. Mateusz Kocielski