★ wanayoo — archive 1999 http://www.php.net/manual/it/function.error-reporting.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to PHP options/info
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageFrench version of this pageHungarian version of this page
PHP options/info
* error_log
* error_reporting
* extension_loaded
* getenv
* get_cfg_var
* get_current_user
* get_magic_quotes_gpc
* get_magic_quotes_runtime
* getlastmod
* getmyinode
* getmypid
* getmyuid
* getrusage
* phpinfo
* phpversion
* php_logo_guid
* php_sapi_name
* putenv
* set_magic_quotes_runtime
* set_time_limit
* zend_logo_guid
* get_loaded_extensions
* get_extension_funcs
* get_required_files
* get_included_files
Manual: error_reporting
View the source code for this pageSearch the site



Previous page
 error_log
 Updated
Sat, 12 Aug 2000
extension_loaded 
Next page


error_reporting

(PHP3 , PHP4 )

error_reporting -- set which PHP errors are reported

Description

int error_reporting ([int level])

Sets PHP's error reporting level and returns the old level. The error reporting level is a bitmask of the following values (follow the links for the internal values to get their meanings):

Tabella 1. error_reporting() bit values

valueinternal name
1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING


User Contributed Notes: error_reporting


webmaster@l-i-e.com
21-May-1999 02:13
There is also an E_ALL which is the first 4 E_xxx added up for you...


arni@linux.is
25-Jan-2000 01:16
If you want to disable error messaging, simply do this in your code:

error_reporting(0);



sbeam@beeline.net
03-Feb-2000 11:31
To arni@linux.js - I read somewhere that turning off error messages when you release your code is like taking off your parachute after you jump out of the plane.

I would like to always use reporting level 8 - it speeds debugging immesely. Somewhat equivalent to using to -w switch in Perl - which should ALWAYS be done. However there doesn't seem to be a way to then <i>test</i> the existence/definition of a variable. i.e. I want to say
<pre>
if (defined($HTTP_COOKIE_VARS["foo"])) { do something...}
</pre>

I still get "Undefined index: foo" when the cookie has not been set yet. Duh - thats why I asked if it was defined. So unfortunately I do have to lower the reporting level to get cookies to work - since the warnings screw up the headers and thus the cookies themselves.



cooper@cooper8.com
13-Feb-2000 02:04
The "isset" function or "empty" function does not produce E_NOTICE errors like "defined" does.


dozprompt@onsea.com
15-Apr-2000 09:14
It is there to protect you from your own code. For example, if you were to test the value of $green without ever assigning it a value, your code may do something you did not expect it to do. Then you would spend unnescessary time debugging. The same 'pickyness' is present in the majority of programming languages; PHP is no different.


hholzgra@php.net
10-Aug-2000 08:17
E_COMPILE_ERROR and friends are missing


 About Notes


Previous page
 error_log
 Updated
Sat, 12 Aug 2000
extension_loaded 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.