Operator priority-PHP operator priority

Source: Internet
Author: User
Operator priority-PHP operator priority

Operator priority-PHP operator priority. For more information, see.


PHP operator priority
Integration direction Operator Additional information
Non-integration Clone new Clone and new
Left [ Array ()
Non-integration ++ -- Increment/decrease operator
Non-integration ~ -(Int) (float) (string) (array) (object) (bool )@ Type
Non-integration Instanceof Type
Right Combination ! Logical operators
Left */% Arithmetic operators
Left + -. Arithmetic operators and string operators
Left <> Bitwise operators
Non-integration <<=>>= <> Comparison Operators
Non-integration =! ===! = Comparison Operators
Left & Bitwise operators and references
Left ^ Bitwise operators
Left | Bitwise operators
Left && Logical operators
Left | Logical operators
Left ? : Ternary operators
Right = + =-= * =/=. = % = & = | = ^ = <=> = Value assignment operator
Left And Logical operators
Left Xor Logical operators
Left Or Logical operators
Left , Multiple application scenarios
This table provides the operator priority (from low to high) for Python ).
From the lowest priority (the loose combination) to the highest priority (the strictest combination ).
This means that in an expression, Python will first calculate the following operators in the table, and then calculate the operators listed in the upper part of the table.

Operator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.