Ben Joyce wrote:
i'm using error_reporting(0) and set_error_handler("MyErrorHandler") to
manage my errors but I'm getting situations where a NOTICE error is thrown.

For example if I refer to $_GET['this'] when there is no 'this' querystring
key then i get the error.

I've tried using @$_GET['this'] but it makes no difference.

Is this normal?

Yes it is. When you use set_error_handler all errors, warnings and notices cause your handler to be called. To detect the use of the @ prefix check the value of error_reporting in your handler - it will be 0 if @ has been used.


Richard Davey wrote:
> Yes because @ suppresses the errors on function calls, not variables
> (which is all $_GET['this'] is).

On the contrary, the @ prefix suppresses all errors for the block of code it precedes where a block is a function or variable. Essentially it sets error_reporting to 0 while it evaluates that block.

--
Stuart

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



Reply via email to