#39609 [Opn->WFx]: increment/decrement inconsistency
| From: | derick@php.net | Date: | Tue, 01 Jan 2008 14:34:22 +0000 |
| Subject: | #39609 [Opn->WFx]: increment/decrement inconsistency | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-120973@lists.php.net to get a copy of this message | ||
ID: 39609
Updated by: derick@php.net
Reported By: arpad@php.net
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
PHP Version: 5.2.0
New Comment:
I don't know why you'd want to write unreadable code like this...
Previous Comments:
------------------------------------------------------------------------
[2007-12-31 23:06:44] michael at chunkycow dot com dot au
G'day
Just use brackets, eg. 1-(--$a).
I could not imagine why you would want to complicate the parser in
order to do such confusing constructs, the non-bracketed version certain
does not pass the 1am test.
1am test: read your code at 1 am after a full day of working, if it
makes sense then it passes :)
------------------------------------------------------------------------
[2006-11-23 16:50:26] tony2001@php.net
Reclassified as feature request.
------------------------------------------------------------------------
[2006-11-23 16:31:22] arpad@php.net
Description:
------------
Using the increment or decrement operators immediately following
respectively a plus or minus with a non-variable expression produces a
parse error.
Reproduce code:
---------------
($a+++$b) // works
(1+$a++) // works
(1-++$a) // works
($a+++1) // works
(1+++$a) // parse error
($a---$b) // works
(1-$a--) // works
(1+--$a) // works
($a---1) // works
(1---$a) // parse error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39609&edit=1