CARVIEW |
Select Language
HTTP/2 200
server: myracloud
date: Tue, 14 Oct 2025 10:56:23 GMT
content-type: text/html; charset=utf-8
content-length: 2870
vary: accept-encoding
content-encoding: gzip
expires: Tue, 14 Oct 2025 10:56:23 GMT
cache-control: max-age=0
etag: "myra-e6fe9624"
php.internals: Re: [PROPOSAL] Alphanumeric decrement
Re: [PROPOSAL] Alphanumeric decrement
From: Martin Amps Date: Thu, 12 Dec 2013 21:32:51 +0000 Subject: Re: [PROPOSAL] Alphanumeric decrement References: 1 2 3 Groups: php.internals Request: Send a blank email to internals+get-70610@lists.php.net to get a copy of this message
This topic has been discussed before, see https://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 > https://ajf.me/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >
Thread (22 messages)
« previous | php.internals (#70610) | next » |
---|