Hi Earnest. I found these user notes in the PHP manual, but, it's confusing
and seems to be a bit contradictory:

-----[snip]-----

error_reporting() has no effect if you have defined your own error handler
with set_error_handler()

[Editor's Note: This is not quite accurate.

E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR and
E_COMPILE_WARNING error levels will be handled as per the error_reporting
settings. 

All other levels of errors will be passed to the custom error handler
defined by set_error_handler().

-----[/snip]-----

PHP's error-handling seems to need to re-working. I just can't get this to
work after having tried some other things I found online. All I want is for
PHP to NOT report E_NOTICE errors, but, there seems to be no way to do this,
even if I re-define the E_NOTICE constant vars.

Thanks.


> From: [EMAIL PROTECTED] (Ernest E Vogelsinger)
> Newsgroups: php.general
> Date: Sun, 10 Nov 2002 10:42:05 +0100
> To: Monty <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] set_error_handler() Keeps Triggering Errors
> 
> At 06:34 10.11.2002, Monty said:
> --------------------[snip]--------------------
>> When I use set_error_handler('error_function') in my scripts, errors are
>> constantly being triggered that I've never seen before. If I comment the
>> handler function out, the errors go away. I have the error reporting set
>> very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it
> 
> It's somewhere in the docs - can't remember where just now, I believe
> isomewhere in the user comments for error_handler:
> 
> your error_handler gets _all_ type of error,warning,notice, regardless of
> the actual setting of error_reporting (which only decides if the
> error/warning/notice gets sent to the client or not).
> 
>> keeps triggering an error, because the error I keep getting is:
>> 
>> Undefined variable: target
>> 
>> This is the same error message no matter what script I run. I don't even use
>> a variable named $target anywhere in any of my scripts, so, this is
>> baffling. And this seems like an E_NOTICE error message, but, I'm only
>> asking for E_ERROR and E_USER_ERROR notices.
> --------------------[snip]--------------------
> 
> Might point to a dynamic variable named target:
> 
> <?php
> error_reporting(E_ALL);
> $varname = 'target';
> if ($$varname) {
> ;
> }
> ?>
> 
> 
> gets me
> Notice: Undefined variable: target in /www/test/test.php on line 4
> 
> Do a grep for "target" on your source files.
> 
> 
> -- 
>> O     Ernest E. Vogelsinger
> (\)    ICQ #13394035
> ^     http://www.vogelsinger.at/
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to