Php error control operator usage example Summary

Source: Internet
Author: User
Tags php error php operator
Today, I will explain the "error control operator" in the PHP operator ". First, let's take a look at what error control operators do? The error control operator, as its name implies, is used to control error output. this control only shields error information and prevents it from being displayed. it does not actually solve the error. The method is simple, that is, add "@" before the wrong expression. You can use this operator to block unnecessary error messages when using some functions in a program, provided that this error message does not affect the running of the program. If you have some impact on the process... today, I will explain to you the "error control operator" in the PHP operator ". First, let's take a look at what error control operators do? The error control operator, as its name implies, is used to control error output. this control only shields error information and prevents it from being displayed. it does not actually solve the error. The method is simple, that is, add "@" before the wrong expression. You can use this operator to block unnecessary error messages when using some functions in a program, provided that this error message does not affect the running of the program. If errors that affect program operations are not recommended, it is not conducive to eliminating program errors. Note that the "@" error controller cannot be placed before the function or class definition, or used in the condition structure. The "@" control operator is only valid for the expression. Simply put, if a value is obtained from a place, we can put @ in front of it. For example, place @ in front of variables, constants, and function calls. Next, let's take a look at the example of the error control operator. when we open a non-existent file, we use "@" to block it.

1. PHP operator (7) "error control operator" example

Introduction: PHP supports an error control operator :@. Before placing the expression in a PHP expression, any error information that may be generated by the expression is ignored. If set_error_handler () is used to set the custom

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

Introduction: This article mainly introduces basic php operators, array operators, error control operators, and basic knowledge. For more information about PHP tutorials, see.

6. Java operator PHP reading notes (4)-operator

Introduction: Java operators PHP reading notes (4)-Operators: What are operators and what are operators? An operator is an identifier that tells PHP to perform related operations. For example, if you want to calculate the value equal to 123 multiplied by 456, you need a symbol to tell the server that you need to perform a multiplication operation. What are the operators in PHP? PHP operators include arithmetic operators, value assignment operators, comparison operators, ternary operators, logical operators, string concatenation operators, and error control operators. The arithmetic operators in PHP are mainly used for arithmetic operations, such as addition, subtraction, and multiplication.

7. learn PHP operators at the front end, learn PHP operators _ PHP Tutorial

Introduction: The frontend learns PHP operators and PHP operators. PHP operators, PHP operators, directory arithmetic operators, value assignment operators, comparison operators, ternary operators, logical operators, string operators, error control operators, incremental delivery

8. Php operator, process system, function

Introduction: Php operators, process control, and functions? 1. Php operator 1.1 ,???? Arithmetic operators: +,-, *,/, %, ++, -- 1.2 ,???? Assignment operators: =, + =,-=, * =,. = 1.3 ,???? Comparison Operators: = ,! =, <>, <,>, <=,> = ,? : 1.4 ,???? Error Control Operator: Php supports error control.

[Related Q & A recommendations ]:

PHP provides an error control operator "@"? What is this?

The above is a summary of php error control operator usage examples. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.