#44252 [Opn->Bgs]: ? : evaluation bug
| From: | felipe@php.net | Date: | Tue, 26 Feb 2008 12:47:31 +0000 |
| Subject: | #44252 [Opn->Bgs]: ? : evaluation bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122720@lists.php.net to get a copy of this message | ||
ID: 44252
Updated by: felipe@php.net
Reported By: OlafvdSpek at GMail dot Com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux, Windows
PHP Version: 5.2.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is documented.
See the example#3:
http://docs.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary
Previous Comments:
------------------------------------------------------------------------
[2008-02-26 12:35:20] OlafvdSpek at GMail dot Com
Description:
------------
The following code echoes 3 while it should echo 2.
It should be evaluated as 1 ? 2 : (0 ? 3 : 4). I've no idea how PHP
comes up with 3.
Reproduce code:
---------------
echo 1 ? 2 : 0 ? 3 : 4;
Expected result:
----------------
2
Actual result:
--------------
3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44252&edit=1