#30248 [NEW]: Ternary operator nesting is wrong
| From: | RAbbott at CalStateLA dot edu | Date: | Mon, 27 Sep 2004 01:02:17 +0000 |
| Subject: | #30248 [NEW]: Ternary operator nesting is wrong | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-66736@lists.php.net to get a copy of this message | ||
From: RAbbott at CalStateLA dot edu
Operating system: Windows 2000
PHP version: 4.3.7
PHP Bug Type: Feature/Change Request
Bug description: Ternary operator nesting is wrong
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 bug report at http://bugs.php.net/?id=30248&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30248&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30248&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30248&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30248&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30248&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30248&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30248&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30248&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30248&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30248&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30248&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30248&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30248&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30248&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30248&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30248&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30248&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30248&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30248&r=mysqlcfg