Re: Feature Proposal: Allow letter decrementing

From: Date: Thu, 18 Jul 2013 14:20:58 +0000
Subject: Re: Feature Proposal: Allow letter decrementing
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-68161@lists.php.net to get a copy of this message
> 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="ZZ";$x++;var_dump($x);' returns string(3) "AAA" '$x=" ZZ";$x++;var_dump($x);' returns string(3) " AA" Regards, Mateusz Kocielski

« previous php.internals (#68161) next »