In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "the operation coincidence set of PHP". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn the "PHP operation coincidence set" bar!
The PHP operator is an important part of the PHP language, and it is a tool for constructing PHP language expressions. First, arithmetic operators can operate on integer and floating-point data. The PHP arithmetic operator is shown in the following table: operator name describes the integer part of PHP 7 adding x plus x and y and 1+2x-y minus x and y by 2-1x*y multiplying the product of x and y 2*3x/y divided by x divided by y quotient 4/2x%y (remainder of division) x divided by the remainder of y x x inverted-3intdiv (xmum y) divided by x divided by y the integer part of quotient
Code example:
Calculation result:
thirteen
seven
thirty
3.3333333333333
one
three
II. Increasing and decreasing operators
The table is as follows:
Operator name description + + x pre-increment x first add 1, then return the value of x, then return the value of x, then increase x, then return the value of x, then add 1, and then subtract x by 1, then return the value of x -, then return the value of x, and then add 1.
Code example:
Calculation result:
3569
III. Comparison operator
The table is as follows:
Operator name returns true if x equals y, otherwise returns true if x is equal to y and the two data types are the same, returns true if x is not equal to y, otherwise returns true if x is not equal to y, or if the two types are different Otherwise, return falsex > y greater than if x is greater than y, return true, otherwise return falsex=y greater than or equal to y, return true, otherwise return falsex IV, logical operator
The table is as follows:
Operator names describe an and b and return truex or y only if an and b are true or at least one of an and b is true return truea xor b XOR an and b only one true returns truea & & b and an and b return truea if both an and b are true | | b or at least one of an and b is true but not true when an is true and false,an is false
Code example:
5. Ternary operator
The format is as follows:
(expr1)? (expr2): (expr3)
When expr1 evaluates to true, the above expression returns the value of expr2, otherwise it returns the value of expr3.
You can omit expr2, where the syntax format is: (expr1)?: (expr3). Similarly, expr1 is returned when expr1 evaluates to true, otherwise expr3 is returned.
There is an additional NULL merge operator in PHP 7. For example, (expr1)? (expr2) returns the value of expr1 when expr1 is not NULL, otherwise the value of expr2 is returned. The code example is as follows:
String concatenation operator
English characters are used in PHP. Concatenate two or more strings. The code example is as follows:
Display the results:
Hello world
7. Assignment operator assignment operator is to assign the value on the right side of the basic assignment operator = to the variable or constant on the left, as shown in the following table: operator example expansion = $a='b'$a='b'+=$a+=5$ a=$a+5-=$a-=5$ a=$a-5*=$a*=5$ a=$a/5.=$a.=5$ a=$a.5%=$a%=5$ a% 58, bit operator
The table is as follows:
Operator acts on an instance & bitwise and $astub | bitwise or $a | $b^ bitwise or $a ^ $b~ bitwise inverse ~ $broomb
Sample code:
Running result:
eight
fifteen
seven
-16
262144
0
Note: in PHP 7, the position with negative displacement will produce an exception, and the left displacement will return 0 if the left displacement exceeds the number of digits. For example, the echo (1 > >-1) program reports an error: Fatal error:Uncaught ArithmeticError:Bit shift by negative number.
At this point, I believe that everyone has a deeper understanding of the "PHP operation coincidence set", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.