# php运算符优先级

**URL:** <https://www.shiqidu.com/t/topic/391>\
**Category:** 开发调优\
**Tags:** PHP\
**Created:** [2018 年4 月 3 日 02:14 UTC](https://www.shiqidu.com/t/topic/391 "2018-04-03T02:14:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![Eureka](https://www.shiqidu.com/user_avatar/www.shiqidu.com/eureka/32/5_2.png) [@Eureka](https://www.shiqidu.com/u/Eureka)\
发布日期： [2018 年4 月 3 日 02:14 UTC](https://www.shiqidu.com/t/topic/391/1 "2018-04-03T02:14:18Z")

</div>

| 结合方向 | 运算符 | 附加信息 |
| --- | --- | --- |
| 无 | clone new | clone 和 new |
| 左 | [ | array() |
| 右 | \*\* | 算术运算符 |
| 右 | ++ – ~ (int) (float) (string) (array) (object) (bool) @ | 类型和递增／递减 |
| 无 | instanceof | 类型 |
| 右 | ! | 逻辑运算符 |
| 左 | \* / % | 算术运算符 |
| 左 | + - . | 算术运算符和字符串运算符 |
| 左 | \<\< \>\> | 位运算符 |
| 无 | \< \<= \> \>= | 比较运算符 |
| 无 | == != === !== \<\> \<=\> | 比较运算符 |
| 左 | & | 位运算符和引用 |
| 左 | ^ | 位运算符 |
| 左 | | |
| 左 | && | 逻辑运算符 |
| 左 | | |
| 左 | ?? | 比较运算符 |
| 左 | ? : | ternary |
| right | = += -= \*= \*\*= /= .= %= &= | = ^= \<\<= \>\>= |
| 左 | and | 逻辑运算符 |
| 左 | xor | 逻辑运算符 |
| 左 | or | 逻辑运算符 |
