When learning PHP, you may encounter the precedence of the PHP operator, here will explain the PHP operator priority problem resolution, here to share with you. PHP supports an error control operator: @. Any error messages that may be generated by the expression are ignored until it is placed in a PHP expression. If the track_errors attribute is activated, any error messages generated by the expression are stored in the variable $php_errormsg. This variable is overwritten every time an error occurs, so check it out as soon as possible if you want to use it.
- Php
- $ My_file = @file (' non_existent_file ') or
- Die ("Failedopeningfile:errorwas ' $php _errormsg '");
- $ value =@ $cache [$key];
- ?>
Note: The @ operator is only valid for an expression. A simple PHP operator precedence rule for beginners is that if you can get a value from somewhere, you can precede it with the @ operator. For example, you can put it in variables, functions and include () calls, constants, and so forth. It cannot be placed before the definition of a function or class, nor can it be used for conditional structures such as if and foreach. Execute operator: PHP supports an execution operator: an inverse quotation mark ('). Note that this is not a single quote! PHP will attempt to execute the contents of the anti-quote as a shell command and return its output information (for example, it can be assigned to a variable instead of simply discarding it to standard output). The effect of using the inverse quote operator "'" is the same as the function shell_exec ().
- Php
- $ Output = ' Ls-al ';
- echo " <pre> $output pre>";
- ?>
Note: The anti-quote operator is not valid when Safe mode is activated or shell_exec () is turned off.
Add one/minus one operator:
+ + $a the value of $ A before plus one, and then return $ A.
$a + + Returns a $ A and then adds a value of $ A.
--$a the value of $ A before minus one, then return $ A.
$a-minus a $ A, and then subtract a $ A value by one.
This is the C language of self-addition, self-reduction as a simple example to deepen the
- <html>
- <head>
- < title > PHP constant Definition--Tao essay title>
- head>
- <body>
- php
- $ a = 3 ;
- $ a =++ $a;
- echo$a. " <br> ";
- Output value is 4
- $ a = 3 ;
- $ a = $a + +;
- echo$a;
- Output value is 3
- ?>
- body>
- html>
http://www.bkjia.com/PHPjc/446482.html www.bkjia.com true http://www.bkjia.com/PHPjc/446482.html techarticle When learning PHP, you may encounter the precedence of the PHP operator, here will explain the PHP operator priority problem resolution, here to share with you. PHP supports a wrong ...