PHP: error_reporting - Manual in Deutsh
PHP: error_reporting - Manual in French
PHP: error_reporting - Manual in Polish

You Are At PHP: error_reporting - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

error_reporting

(PHP 3, PHP 4, PHP 5)

error_reporting -- Sets which PHP errors are reported

Description

int error_reporting ( [int level] )

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script.

Parameters

level

The new error_reporting level. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. As error levels are added, the range of integers increases, so older integer-based error levels will not always behave as expected.

The available error level constants are listed below. The actual meanings of these error levels are described in the predefined constants.

Table 1. error_reporting() level constants and bit values

valueconstant
1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING
64 E_COMPILE_ERROR
128 E_COMPILE_WARNING
256 E_USER_ERROR
512 E_USER_WARNING
1024 E_USER_NOTICE
6143 E_ALL
2048 E_STRICT
4096 E_RECOVERABLE_ERROR

Return Values

Returns the old error_reporting level.

ChangeLog

VersionDescription
5.0.0E_STRICT introduced (not part of E_ALL).
5.2.0E_RECOVERABLE_ERROR introduced.
6E_STRICT became part of E_ALL.

Examples

Example 1. error_reporting() examples

<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>

Notes

Warning

Most of E_STRICT errors are evaluated at the compile time thus such errors are not reported in the file where error_reporting is enhanced to include E_STRICT errors (and vice versa).

See Also

The display_errors directive
ini_set()

bes
super efektowne kasetony reklamowe najlepsza reklama dla Ciebie
Super norma expert Norma expert dla ciebie
wydruki duży format duży format lublin skanowanie dokumentacji duży A0
plakaty duży format plakaty lublin duży format plakatay A0,A1,A2,A

Another Useful functions:


zend-api.zend-stream-ferror | zend-api.zend-get-error-exception | zend-api.zend-exception-error | zend-api.zend-error | zend-api.tsrm-error | zend-api.tsrm-error-set | security.errors | ref.errorfunc | phpdevel-errors | migration52.errorrep | migration52.error-messages | migration4.error-reporting | migration.errors | migrating5.errorrep | language.operators.errorcontrol | internals.pdo.error-handling | function.yaz-error | function.xslt-set-error-handler | function.xslt-error | function.xml-get-error-code | function.xml-error-string | function.vpopmail-error | function.user-error | function.use-soap-error-handler | function.udm-error | function.trigger-error | function.tidy-get-error-buffer | function.tidy-error-count | function.sybase-min-error-severity | function.sqlite-last-error | function.sqlite-error-string | function.socket-strerror | function.socket-last-error | function.socket-clear-error | function.set-error-handler | function.session-pgsql-get-error | function.session-pgsql-add-error | function.sesam-errormsg | function.samconnection-error | function.restore-error-handler | function.radius-strerror | function.qdom-error | function.preg-last-error | function.posix-strerror | function.posix-get-last-error | function.pg-set-error-verbosity | function.pg-result-error | function.pg-result-error-field | function.pg-last-error | function.pdostatement-errorinfo | function.pdostatement-errorcode | function.pdo-errorinfo | function.pdo-errorcode | function.ora-errorcode | function.ora-error | function.openssl-error-string | function.odbc-errormsg | function.odbc-error | function.ocierror | function.oci-error | function.mysqli-stmt-error | function.mysqli-error | function.mysqli-connect-error | function.mysql-error | function.mssql-min-error-severity | function.msql-error | function.maxdb-stmt-error | function.maxdb-error | function.maxdb-connect-error | function.m-connectionerror | function.libxml-use-internal-errors | function.libxml-get-last-error | function.libxml-get-errors | function.libxml-clear-errors | function.ldap-error | function.ircg-fetch-error-msg | function.ingres-error | function.imap-last-error | function.imap-errors | function.imagick-iserror | function.imagick-error | function.ifx-errormsg | function.ifx-error | function.hwapi-error-reason | function.hwapi-error-count | function.hw-errormsg | function.hw-error | function.harudoc-reseterror | function.gnupg-seterrormode | function.gnupg-geterror | function.fdf-error | function.fbsql-error | function.error-reporting | function.error-log | function.error-get-last | function.enchant-dict-get-error | function.enchant-broker-get-error | function.dbx-error | function.db2-stmt-errormsg | function.db2-stmt-error | function.db2-conn-errormsg | function.db2-conn-error | function.curl-error | function.bzerror | features.file-upload.errors | |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.