Doc #51454 [Csd]: Operator => missing from the precedence list
| From: | peev dot alexander at gmail dot com | Date: | Fri, 02 Apr 2010 14:10:32 +0000 |
| Subject: | Doc #51454 [Csd]: Operator => missing from the precedence list | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4145@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51454&edit=1
ID: 51454
User updated by: peev dot alexander at gmail dot com
Reported by: peev dot alexander at gmail dot com
Summary: Operator => missing from the precedence list
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
Assigned To: rquadling
New Comment:
Thank you for your quick action, but I'm not sure this is the correct
precedence for that operator:
since '=>' and the ('or', 'and' and 'xor' ) operators
can be used together, (through testing) I have found out
that the precedence of the '=>' operator is between
the 'or' operator and the ',' operator,
and that it has no associativity.
Please correct me if I'm wrong.
(example:
var_dump(array('key1' => TRUE xor TRUE));
will yield:
array(1) {
["key1"]=>
bool(false)
}
, and:
var_dump(array(0 or 'key2' => TRUE));
will yield:
array(1) {
[1]=>
bool(true)
}
)
Previous Comments:
------------------------------------------------------------------------
[2010-04-01 13:52:56] rquadling@php.net
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.
------------------------------------------------------------------------
[2010-04-01 13:51:28] rquadling@php.net
Automatic comment from SVN on behalf of rquadling
Revision: http://svn.php.net/viewvc/?view=revision&revision=297272
Log: Document array key => value operator assignment. Fix bug#51454
------------------------------------------------------------------------
[2010-04-01 13:31:03] peev dot alexander at gmail dot com
P.S. I was going to write a comment on the manual page, but unless the
developers don't consider it a bug, I won't proceed with posting it.
------------------------------------------------------------------------
[2010-04-01 13:25:44] peev dot alexander at gmail dot com
Description:
------------
On the 'Operator precedence' manual page(
http://www.php.net/manual/en/language.operators.precedence.php
)
the => operator seems to be missing from the list. Its precedence might
be obvious to some, or most,
but I suppose it would be better if it is included in the php
documentation.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51454&edit=1