PHP error_reporting() fonsi

tashin

tasiyarin kanan dace dake:

<?php
 // yancu rahmar dace
 error_reporting(0);
 // rahmar dace dake
 error_reporting(E_ERROR | E_WARNING | E_PARSE);
 // Report all errors
 error_reporting(E_ALL);
 // Equivalent to error_reporting(E_ALL);
 ini_set("error_reporting", E_ALL);
 // Report all errors except E_NOTICE
 error_reporting(E_ALL & ~E_NOTICE);
?> 

Definition and Usage

The error_reporting() function specifies what kind of PHP errors should be reported.

The error_reporting() function can set the error_reporting directive at runtime.

PHP has many error levels, and this function can set the level at runtime. level, error_reporting() will only return the current error reporting level.

Syntax

error_reporting(level);
Parameter Description
level

Optional. Specifies a new error_reporting level. It can be a bitmask or a named constant.

Note:It is strongly recommended to use named constants to ensure compatibility with future versions. Due to the addition of error levels and the increase in integer value ranges, the older integer-based error levels may not always behave as expected.

The available error level constants and their actual meanings are described in predefined constants.

Technical Details

Return value: Returns the old error_reporting Level, or in level Returns the current level if no parameters are given.
PHP Version: 4.0+