PHP error and exception notes and summary (10) Error processor test

Source: Internet
Author: User
Tags php error

Associated files: myerrorhandler.php (previous)

Test the custom handling of the notification level error first:

testerrorhandler.php

<? PHP require_once ' myerrorhandler.php '; error_reporting ( -1); Set_error_handler (array(' MyErrorHandler ', ' deal ')); // Notification level Error Echo $notice;

Run, generate NoticeLog.log in D:\practise\php\From\notice:

            A notification error occurred, as follows:            the file that generated the notification: D: \practise\php\from\testerrorhandler.  PHP            generated notification information: Undefined variable: notice            The line number that generatedthe notification: 7             The time that the notification was generated:2015-06-14 11:21:29;        

When you test for warnings and fatal levels of errors, you need to configure the messaging system to send messages to the administrator when an error occurs (see: PHP Error and exception notes and summary (7) Send the error log by mail).

The following level of errors cannot be handled by user-defined functions E_ERROR : E_PARSE E_CORE_ERROR , E_CORE_WARNING E_COMPILE_ERROR ,,,, E_COMPILE_WARNING , and most E_STRICT of the files produced in the file where the set_error_handler () function is called.

Reference: Windows PHP sendmail Configuration implementation

PHP error and exception notes and summary (10) Error processor test

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.