#30248 [Opn->Bgs]: Ternary operator nesting is wrong
| From: | amt@php.net | Date: | Mon, 27 Sep 2004 02:01:08 +0000 |
| Subject: | #30248 [Opn->Bgs]: Ternary operator nesting is wrong | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66739@lists.php.net to get a copy of this message | ||
ID: 30248
Updated by: amt@php.net
Reported By: RAbbott at CalStateLA dot edu
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Windows 2000
PHP Version: 4.3.7
New Comment:
This is a known issue, but it's not going to change
because it will break backwards compatibility. Sorry.
Previous Comments:
------------------------------------------------------------------------
[2004-09-27 03:02:14] RAbbott at CalStateLA dot edu
Description:
------------
The ternary expression operators '?' and ':' nest improperly.
The issue was reported by abodeman@yahoo as a comment on the Operators
page: http://us2.php.net/language.operators.
He reports it as a nuisance. It's more than that. It is a either an
implementation error or an error in the specification of the language.
Here is an example.
<pre>
X = A ? B :
C ? D :
E;
parses as if it were written as follows.
X = (A ? B :
C) ? D :
E;
It should parse as if it is written like this.
X = A ? B :
(C ? D :
E);
</pre>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30248&edit=1