#50372 [NEW]: Ternary statements are not identical
| From: | jakeophobia at gmail dot com | Date: | Thu, 03 Dec 2009 12:13:16 +0000 |
| Subject: | #50372 [NEW]: Ternary statements are not identical | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-3392@lists.php.net to get a copy of this message | ||
From: jakeophobia at gmail dot com
Operating system:
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: Ternary statements are not identical
Description:
------------
On page: http://www.php.net/manual/en/language.operators.comparison.php
In 'Example #3 Non-obvious Ternary Behaviour'
The two statements are not 'identical'.
The second ternary statment has parenthesis on 'false'
Expected result:
----------------
...
echo (true?'true':false?'t':'f');
...the following is a more obvious version of the same code as above...
echo ((true ? 'true' : false) ? 't' : 'f');
...
Actual result:
--------------
...
echo (true?'true':false?'t':'f');
...the following is a more obvious version of the same code as above...
echo ((true ? 'true' : 'false') ? 't' : 'f');
...
--
Edit bug report at http://bugs.php.net/?id=50372&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50372&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50372&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50372&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50372&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50372&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50372&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50372&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50372&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50372&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50372&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50372&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50372&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50372&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50372&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50372&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50372&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50372&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50372&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50372&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50372&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50372&r=mysqlcfg