美文网首页PHP Chaos
PHP: Operator Precedence

PHP: Operator Precedence

作者: xiaojianxu | 来源:发表于2017-01-04 11:52 被阅读2次

    The following table lists the operators in order of precedence, with the highest-precedence ones at the top. Operators on the same line have equal precedence, in which case associativity decides grouping.

    Operator Precedence

    Associativity Operators Additional Information
    non-associative clone new clone and new
    left [ array()
    right **** arithmetic
    right ++ -- ~ (int) (float) (string) (array) (object) (bool) @ types and [increment/decrement] (http://php.net/manual/en/language.operators.increment.php)
    non-associative instanceof types
    right ! logical
    left *** / % arithmetic
    left + - . arithmetic and string
    left << >> bitwise
    non-associative < <= > >= comparison
    non-associative == != === !== <> <=> comparison
    left & bitwise and references
    left ^ bitwise
    left / bitwise
    left && logical
    left // logical
    right ?? comparison
    left ? : ternary
    right = += -= *= **= /= .= %= &= /= ^= <<= >>= assignment
    left and logical
    left xor logical
    left or logical

    相关文章

      网友评论

        本文标题:PHP: Operator Precedence

        本文链接:https://www.haomeiwen.com/subject/rbeovttx.html