CARVIEW |
Select Language
HTTP/2 200
server: myracloud
date: Tue, 14 Oct 2025 01:17:49 GMT
content-type: text/html; charset=utf-8
content-length: 2713
vary: accept-encoding
content-encoding: gzip
expires: Tue, 14 Oct 2025 01:17:49 GMT
cache-control: max-age=0
etag: "myra-dfa75daa"
php.internals: Re: [PROPOSAL] Alphanumeric decrement
Re: [PROPOSAL] Alphanumeric decrement
From: Rowan Collins Date: Mon, 16 Dec 2013 18:26:20 +0000 Subject: Re: [PROPOSAL] Alphanumeric decrement References: 1 2 3 4 5 6 Groups: php.internals Request: Send a blank email to internals+get-70666@lists.php.net to get a copy of this message
Tjerk Meesters wrote (on 13/12/2013):Basically it makes theYes please! One of my colleagues once raised a bug that currently incrementing null results in 1, but decrementing it results in it remaining null. On the other hand,$x++
or++$x
work as if you types$x += 1
or$x = $x + 1
(except for arrays, currently) ++null becomes int(1), --null becomes int(-1)null -= 1
results in -1 as you would expect. The bug was closed as invalid, stating that this is documented behaviour, but I have never understood why this would be anything other than an accidental side effect of implementation, nor why you would ever rely on it.++"123a" becomes "123b" but with a notice that string increment is deprecatedLukewarm on this part; the current syntax seems fairly logical to me, and the proposed new functions more ugly for no very good reason. Regards, -- Rowan Collins [IMSoP]
Thread (22 messages)
« previous | php.internals (#70666) | next » |
---|