Home  >  Article  >  Backend Development  >  PHP error control operator usage example summary

PHP error control operator usage example summary

伊谢尔伦
伊谢尔伦Original
2017-06-11 13:13:122031browse

Today I will explain to you the "error control operator" in PHP operators. First, let’s understand what the error control operator does? As the name suggests, the error control operator is used to control error output. This control only blocks the error information and prevents it from being displayed. It does not really solve the error. The method is very simple, just add "@" before the wrong expression. When unnecessary error messages often appear when using certain functions in a program, you can use this operator to shield them, provided that the error message does not affect the running of the program. If there are some errors that affect program operation, we do not recommend using error control characters, as this is not conducive to eliminating program errors. There is something to note here. Our "@" error control symbol cannot be placed before the definition of a function or class, nor can it be used in conditional structures, etc. The "@" control character is only valid for expressions. To put it simply: if we get a value from a place, we can put @ in front of it. For example, put @ in front of variables, constants, and function calls. Let's take a look at the usage examples of error control operators. When we open a file that does not exist, use "@" to shield

1. PHP Operator (7) "Error Control Operator" example explanation

PHP error control operator usage example summary

## Introduction: The error control operator, as the name suggests, is used to control error output. This The control only blocks the error message and prevents it from being displayed. It does not really solve the error. The method is very simple, just add "@" before the wrong expression.

2. PHP Operator (1) "Arithmetic Operator" Example Example

PHP error control operator usage example summary

Introduction: An operator is a symbol used to calculate variables, constants or data. It is a specified operation performed on a value or a group of values. PHP operators: arithmetic operators, string operators, assignment operators, bitwise operators, logical operators, comparison operators, increment or decrement operators, error control operators. We will explain them to you separately later. Let's first explain the arithmetic operators in PHP operators.

3. PHP Basic Tutorial Three Operators

PHP error control operator usage example summary

##Introduction: What is explained in this section Arithmetic operators Increment and decrement operators Assignment operators String operators Comparison operators Bit operators Logical operators Ternary operators Error control operators

4.

php error control operator

PHP error control operator usage example summary##Introduction: PHP supports a Error control operator: @. When placed before a PHP expression, any error message that expression may produce is ignored. If you use set_error_handler() to set a custom

5.

php basic operators, array operators, error control operators and basic knowledge

Introduction:: This article mainly introduces PHP basic operators, array operators, error control operators and basic knowledge. Students who are interested in PHP tutorials can refer to it.

6.

Java Operator PHP Reading Notes (4) - Operator

Introduction: Java operators: Java operators PHP reading notes (4) - Operators: What is an operator? What is an operator? Operators are identifiers that tell PHP to perform related operations. For example, if you need to calculate what 123 times 456 equals, then you need a symbol to tell the server that you need to do multiplication. What are the operators in PHP? PHP operators are generally divided into arithmetic operators, assignment operators, comparison operators, ternary operators, logical operators, string concatenation operators, and error control operators. Arithmetic operators in PHP Arithmetic operators are mainly used for arithmetic operations, such as addition, subtraction, and multiplication

7. Front-end learning PHP operations Operators, learn PHP operators_PHP tutorial

Introduction: Learn PHP operators on the front end, learn PHP operators. Learn the operators of PHP on the front end, learn the operator directory of PHP, arithmetic operators, assignment operators, comparison operators, ternary operators, logical operators, string operators, error control operators, increment increments

8. Php operators, process control, functions

Introduction: Php operators, process control, functions ​ ? 1. Php operator 1.1. ???? Arithmetic operator: +, -, *, /, %, ++, -- 1.2. ???? Assignment operator: =, +=, -=, *=, .= 1.3. ???? comparison operator: ==, !=, <>, <, >, <=, >=, ? : 1.4. ???? Error control operator: Php supports an error control

[Related Q&A recommendations]:

Does PHP provide an error control operator "@"? What on earth is this "@"?

The above is the detailed content of PHP error control operator usage example summary. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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