国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
定義和用法
語(yǔ)法
Home php教程 php手冊(cè) PHP Error 和 Logging 函數(shù)

PHP Error 和 Logging 函數(shù)

Jun 21, 2016 am 08:53 AM
error handler logging set

PHP Error 和 Logging 簡(jiǎn)介

error 和 logging 函數(shù)允許你對(duì)錯(cuò)誤進(jìn)行處理和記錄。

error 函數(shù)允許用戶定義錯(cuò)誤處理規(guī)則,并修改記錄錯(cuò)誤的方式。

logging 函數(shù)允許用戶對(duì)應(yīng)用程序進(jìn)行日志記錄,并把日志消息發(fā)送到電子郵件、系統(tǒng)日志或其他的機(jī)器。

PHP Error 和 Logging 函數(shù)

PHP:指示支持該函數(shù)的最早的 PHP 版本。

函數(shù) 描述 PHP
debug_backtrace() 生成 backtrace。 4
debug_print_backtrace() 輸出 backtrace。 5
error_get_last() 獲得最后發(fā)生的錯(cuò)誤。 5
error_log() 向服務(wù)器錯(cuò)誤記錄、文件或遠(yuǎn)程目標(biāo)發(fā)送一個(gè)錯(cuò)誤。 4
error_reporting() 規(guī)定報(bào)告哪個(gè)錯(cuò)誤。 4
restore_error_handler() 恢復(fù)之前的錯(cuò)誤處理程序。 4
restore_exception_handler() 恢復(fù)之前的異常處理程序。 5
set_error_handler() 設(shè)置用戶自定義的錯(cuò)誤處理函數(shù)。 4
set_exception_handler() 設(shè)置用戶自定義的異常處理函數(shù)。 5
trigger_error() 創(chuàng)建用戶自定義的錯(cuò)誤消息。 4
user_error() trigger_error() 的別名。

4

1、?set_error_handler() 函數(shù)

定義和用法

set_error_handler() 函數(shù)設(shè)置用戶自定義的錯(cuò)誤處理函數(shù)。

該函數(shù)用于創(chuàng)建運(yùn)行時(shí)期間的用戶自己的錯(cuò)誤處理方法。

該函數(shù)會(huì)返回舊的錯(cuò)誤處理程序,若失敗,則返回 null。

語(yǔ)法

set_error_handler(error_function,error_types)
參數(shù) 描述
error_function 必需。規(guī)定發(fā)生錯(cuò)誤時(shí)運(yùn)行的函數(shù)。
error_types 可選。規(guī)定在哪個(gè)錯(cuò)誤報(bào)告級(jí)別會(huì)顯示用戶定義的錯(cuò)誤。默認(rèn)是 "E_ALL"。



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

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution to PHP Fatal error: Call to undefined method PDO::prepare() in Solution to PHP Fatal error: Call to undefined method PDO::prepare() in Jun 22, 2023 pm 06:40 PM

PHP is a popular web development language that has been used for a long time. The PDO (PHP Data Object) class integrated in PHP is a common way for us to interact with the database during the development of web applications. However, a problem that some PHP developers often encounter is that when using the PDO class to interact with the database, they receive an error like this: PHPFatalerror:CalltoundefinedmethodPDO::prep

Solve the problem of 'error: incomplete type is not allowed' in C++ code Solve the problem of 'error: incomplete type is not allowed' in C++ code Aug 26, 2023 pm 08:54 PM

Solve the "error:incompletetypeisnotallowed" problem in C++ code. During the C++ programming process, you sometimes encounter some compilation errors. One of the common errors is "error:incompletetypeisnotallowed". This error is usually caused by operating on an incomplete type. This article will explain the cause of this error and provide several solutions. firstly, I

0271: What should I do if the computer cannot be turned on due to real time clock error? 0271: What should I do if the computer cannot be turned on due to real time clock error? Mar 13, 2023 am 11:30 AM

Solution to "0271: real time clock error" that cannot boot: 1. Press F1, and in the interface that appears, move the option bar to the third item "Date/Time"; 2. Manually change the system time to the current one time; 3. Press F10 and select yes in the pop-up dialog box; 4. Re-open the notebook to boot normally.

What should I do if 'Uncaught (in promise) Error: Request failed with status code 500' occurs when using axios in a Vue application? What should I do if 'Uncaught (in promise) Error: Request failed with status code 500' occurs when using axios in a Vue application? Jun 24, 2023 pm 05:33 PM

It is very common to use axios in Vue applications. axios is a Promise-based HTTP client that can be used in browsers and Node.js. During the development process, the error message "Uncaught(inpromise)Error: Requestfailedwithstatuscode500" sometimes appears. For developers, this error message may be difficult to understand and solve. This article will explore this

Solve the 'error: expected initializer before 'datatype'' problem in C++ code Solve the 'error: expected initializer before 'datatype'' problem in C++ code Aug 25, 2023 pm 01:24 PM

Solve the "error:expectedinitializerbefore'datatype'" problem in C++ code. In C++ programming, sometimes we encounter some compilation errors when writing code. One of the common errors is "error:expectedinitializerbefore'datatype'". This error usually occurs in a variable declaration or function definition and may cause the program to fail to compile correctly or

Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Feb 26, 2024 pm 07:48 PM

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

Solution to PHP Fatal error: Call to undefined function mysqli_connect() Solution to PHP Fatal error: Call to undefined function mysqli_connect() Jun 23, 2023 am 09:40 AM

When writing web applications using PHP, a MySQL database is often used to store data. PHP provides a way to interact with the MySQL database called MySQLi. However, sometimes when using MySQLi, you will encounter an error message, as shown below: PHPFatalerror:Calltoundefinedfunctionmysqli_connect() This error message means that PHP cannot find my

How to solve PHP Warning: fopen(): failed to open stream: No such file or directory How to solve PHP Warning: fopen(): failed to open stream: No such file or directory Aug 19, 2023 am 10:44 AM

How to solve PHPWarning:fopen():failedtoopenstream:Nosuchfileordirectory In the process of using PHP development, we often encounter some file operation problems, one of which is "PHPWarning:fopen():failedtoopenstream:Nosuchfileordirectory"

See all articles