Home  >  Article  >  Detailed introduction and usage of trigger_error function

Detailed introduction and usage of trigger_error function

不言
不言Original
2018-05-09 14:32:272636browse

trigger_error() function creates user-level error messages. The trigger_error() function can be associated with a built-in error handler, or a user-defined function can be used as a new error handler (set_error_handler()). Syntax trigger_error(errormsg,errortype); Parameter description errormsg is required. Specifies the error message. Maximum length 1024 bytes. errortype is optional. Specifies the error type. Possible values: E_USER_ERRORE_USER_WARNINGE_USER_NOTICE (default) trigger_error() Example

1. trigger_error function definition and usage summary

Introduction: The trigger_error() function creates user-level error messages . The trigger_error() function can be associated with a built-in error handler, or a user-defined function can be used as a new error handler (set_error_handler()). Syntax trigger_error(errormsg,errortype); Parameter Description errormsg Required. . The maximum length is 1024 bytes. Errortype specifies the error type.

2. php trigger_error() function? Introduction: The trigger_error() function creates a user-level error message. The trigger_error() function can be associated with a built-in error handler, or a user-defined function can be used as a new error handler ( set_error_handler()).

##3. 10 recommended articles about the php trigger_error() function

##Introduction: In some PHP built-in functions (such as mkdir), adding @ in front can shield the errors thrown by the function. How can I achieve this in a custom function? I tried throw new Exception and trigger_error and both cannot be blocked by @. Additional explanation: This is the case. For example, I want to write a JsonFile::get() method that throws an error when the file does not exist, throws an error when the path is illegal, and decodes it. Throw an error when it fails and return false. When the user cares about the error message, he can catch and handle it himself;...Detailed introduction and usage of trigger_error function

4. PHP custom error handling function trigger_error() _PHP Tutorial

Introduction: PHP custom error handling function trigger_error(). Definition and usage trigger_error() function creates user-defined error messages. Trigger an error message under specified conditions. It is the same as the built-in error handler

##5.

Triggering PHP errors through trigger_error in PHP_PHP Tutorial

Introduction: Example of triggering PHP errors through trigger_error in PHP. Examples of triggering PHP errors through trigger_error in PHP This article mainly introduces examples of triggering PHP errors through trigger_error in PHP. This article introduces the error suppressor @ and triggering through trigger_error ##6.

An example of triggering PHP errors through trigger_error in PHP, trigger_errorphp_PHP tutorial

Introduction: An example of triggering PHP errors through trigger_error in PHP, trigger_errorphp. Examples of PHP errors triggered by trigger_error in PHP, trigger_errorphp Examples of PHP errors triggered by trigger_error in PHP [error suppressor @] In addition to error_reporting and displ7 in php.ini.

Use How does trigger_error not display custom exception information

Introduction: How does trigger_error not display custom error information PHP code 8.

How to use trigger_error without displaying custom exception information

Introduction: How come the customized error message is not displayed when using trigger_error? PHP code

9. Example of PHP error triggered by trigger_error in PHP

Introduction: Example of PHP error triggered by trigger_error in PHP. Examples of triggering PHP errors through trigger_error in PHP This article mainly introduces examples of triggering PHP errors through trigger_error in PHP. This article introduces the error suppressor @ and triggering through trigger_error

##10. An example of a PHP error triggered by trigger_error in PHP, trigger_errorphp

Introduction: An example of a PHP error triggered by trigger_error in PHP, trigger_errorphp. Examples of PHP errors triggered by trigger_error in PHP, trigger_errorphp Examples of PHP errors triggered by trigger_error in PHP [error suppressor @] In addition to error_reporting and displ in php.ini

##11.

PHP Example of triggering PHP errors through trigger_error_php example

Introduction: This article mainly introduces examples of triggering PHP errors through trigger_error in PHP. This article introduces the error suppressor @ and Trigger PHP error examples through trigger_error. Friends who need it can refer to

##12.

PHP custom error handling function trigger_error()

Introduction: trigger_error() is used to trigger an error message under user-specified conditions. It is used with the built-in error handler, and can also be used with user-defined functions created by the set_error_handler() function

13.

PHP custom error handling function trigger_error ()_PHP

Introduction: trigger_error() is used to trigger an error message under user-specified conditions. It is used with the built-in error handler, and can also be used with user-defined functions created by the set_error_handler() function

14.

Trigger PHP errors through trigger_error in PHP Example_PHP

Introduction: This article mainly introduces examples of triggering PHP errors through trigger_error in PHP. This article introduces the error suppressor @ and examples of triggering PHP errors through trigger_error. Friends in need can refer to

15.

PHP Custom Error Handling Function trigger_error()_php Tips

Introduction :trigger_error() is used to trigger an error message under user-specified conditions. It is used with the built-in error handler, and can also be used with user-defined functions created by the set_error_handler() function

[Related Q&A recommendations]:

php - Why does echo realpath(RUNTIME_PATH); produce different results in the same method?

How can a custom function in PHP not throw an error when @ is included?

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