Re: Error Suppression with '@'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/2/05, Justin Burger <jburger@xxxxxxxxxxxxxxxx> wrote:
> Good Morning,
> I was having a discussion with a fellow PHP Developer this morning and he
> mentioned that he put's an '@' sign in front of all function calls, and
> every time he accesses an array;

Any chance of revealing his identity - so that I can make sure that I
don't sub-contract him any work.

> 
> I know that this is sloppy, and dangerous, but I don't know exactly what
> this exposes him to, can any one give me any real world examples of why
> this is bad, so I can relate it to his code?

It's bad in that your system normally gives you an error when you do
something wrong. Sometimes your code can recover from errors, but your
code runs better if the errors aren't there.

In production code, you don't want the errors to show up on screen,
mainly because you don't want to expose the code you are using on your
back end. You fix this by modding the correct parameter in php.ini (
display_errors IIRC )

> 
> php.net does not have much information about this. It seems like
> suppressing errors, rather then catching them is problematic.

PHP displays errors for a reason. It is both egotistic, and foolish to
assume that your code will always be perfect. Errors enlighten you
when your code is not perfect, and give you the opportunity to perfect
it.

You can achieve a similar effect by setting display_errors to the
correct setting.

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

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux