|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-04-01 13:25 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 05:00:01 2025 UTC |
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) } )