This topic has been discussed before, see http://marc.info/?l=php-internals&m=137415522724276&w=1
for the thread
On Dec 12, 2013, at 12:33 PM, Andrea Faulds <ajf@ajf.me> wrote:
>
>
> On 12/12/13 20:19, Adam Harvey wrote:
>>
>> I wonder if we'd want to warn when 'a' decrements to 0, since it's a
>> somewhat unintuitive behaviour. (Also, since Perl will decrement 'a'
>> to -1 and Perl was the original inspiration, do we want to decrement
>> to -1 as well for consistency?)
>>
>
> Ooh, I didn't know about Perl's -1 behaviour. That might be a better idea, since
> "z" becoming "aa" suggests that "a" is functions more like 0 here than
> 1. That, or the warning you suggest.
>
> Also, I forgot to mention in my original post, but there is another thing changed by this
> patch. At present, when decrementing a string, it is treated as an integer zero if it is empty. This
> patch also removes that check. This brings incrementing into line with decrementing. ""
> would increment to "1" and decrement to "-1", while at present it decrements to
> -1 (the integer).
> --
> Andrea Faulds
> http://ajf.me/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>