#49772 [Opn->Csd]: Cast operators marked as non-associative
| From: | vrana@php.net | Date: | Fri, 13 Nov 2009 21:40:39 +0000 |
| Subject: | #49772 [Opn->Csd]: Cast operators marked as non-associative | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3139@lists.php.net to get a copy of this message | ||
ID: 49772
Updated by: vrana@php.net
Reported By: mjomble at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-11-13 21:40:36] svn@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=290705
Log: Some unary operators are associative (bug #49772)
------------------------------------------------------------------------
[2009-10-04 23:00:43] mjomble at gmail dot com
Description:
------------
The operator precedence page (language.operators.precedence.php) lists
the following operators as non-associative:
~ - (int) (float) (string) (array) (object) (bool) @
However, all of these seem to behave like right-associative operators.
Examples:
- - 3 evaluates like -(-3)) = 3
~ ~ 3 evaluates like ~(~3)) = 3
- - - 3 evaluates like -(-(-3))) = -3
~ ~ ~ 3 evaluates like ~(~(~3))) = ~3 = -4
(int) (string) 3 evaluates to integer 3
(string) (int) 3 evaluates to string "3"
It's even possible to use the @ operator more than once in front of a
statement. The additional ones don't really do anything useful, but more
importantly, they don't trigger any parse errors.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49772&edit=1