You are here: Re: [PHP] Error Suppression with '@' « PHP « IT news, forums, messages
Re: [PHP] Error Suppression with '@'

Posted by Rory Browne on 08/02/05 21:49

On 8/2/05, Justin Burger <jburger@luthresearch.com> 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
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация