文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Operators

Operators

时间:2008-01-17  来源:xiaoaizhen

** Exponentiation
+ -  * /  Addition, subtraction, multiplication, division
% Modulo division
& | ^ Bitwise AND, bitwise OR, bitwise exclusive OR
>> << Bitwise shift right, bitwise shift left
|| && Logical OR, logical AND
. Concatenation of two strings
x Returns a string or array consisting of the left operand (an array or a string) repeated the number of times specified by the right operand
All of the above operators also have an assignment operator, e.g., .=
-> Dereference operator
\ Reference (unary)
! ~ Negation (unary), bitwise complement (unary)
++ -- Auto-increment (magical on strings), auto-decrement
== != Numeric equality, inequality
eq ne String equality, inequality
< > Numeric less than, greater than
lt gt String less than, greater than
<= >= Numeric less (greater) than or equal to
le ge String less (greater) than or equal to
<=> cmp Numeric (string) compare. Returns -1, 0, 1.
=~ !~ Search pattern, substitution, or translation (negated)
.. Range (scalar context) or enumeration (array context)
?: Alternation (if-then-else) operator
, Comma operator, also list element separator. You can also use =>.
not Low-precedence negation
and Low-precedence AND
or xor Low-precedence OR, exclusive OR

All Perl functions can be used as list operators, in which case they have very high or very low precedence, depending on whether you look at the left or the right side of the operator. Only the operators not, and, or and xor have lower precedence.

A "list" is a list of expressions, variables, or lists. An array variable or an array slice may always be used instead of a list.

Parentheses can be added around the parameter lists to avoid precedence problems.

相关阅读 更多 +
排行榜 更多 +
宝宝情商养成宝宝巴士

宝宝情商养成宝宝巴士

休闲益智 下载
燥热手机版

燥热手机版

飞行射击 下载
巨人狙击手安卓版

巨人狙击手安卓版

飞行射击 下载