Home > Backend Development > PHP Tutorial > PHP error suppressor @ parsing and operator precedence

PHP error suppressor @ parsing and operator precedence

不言
Release: 2023-03-23 20:42:01
Original
1750 people have browsed it

This article mainly introduces the PHP error suppressor @ parsing and operator priority. It has a certain reference value. Now I share it with everyone. Friends in need can refer to it

PHP Support An error control operator: @. When placed before a PHP expression, any error message that expression may produce is ignored.

Operator precedence

/**
 * 下列程序中请写出打印输出的结果
 * <?php
 *
 * $a = 0;
 * $b = 0;
 *
 * if ($a = 3 > 0 || $b = 3 > 0) 
 * {
 *      $a++;
 *      $b++;
 *      echo $a. "\n";
 *      echo $b. "\n";
 * }
 */
$a = 0;
$b = 0;

// 优先级顺序 > || =
if ($a = 3 > 0 || $b = 3 > 0) 
{
    $a++;
    $b++;
    echo $a. "\n";
    echo $b. "\n";
}
Copy after login

Output: 1 1

($a=true,$b=1)


The above is the detailed content of PHP error suppressor @ parsing and operator precedence. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template