By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,967 Members | 1,684 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,967 IT Pros & Developers. It's quick & easy.

Strudel before function

P: n/a
I basically know that when you call a function like @foo(bar), you are
supressing error messages.

But I have never found out how to *really* use it. Most of the error
messages I get mean that I have to fix something right now once and
for all. Supressing an error message doesn't supress the error. And
this little strudel doesn't seem to do anything useful for me.

So maybe I need to learn something. But I can't find anything in the
PHP docs in regards to it.

Anybody can point me to some useful information on it?

Apr 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 27, 10:21 am, Razzbar <g...@potatoradio.f2s.comwrote:
I basically know that when you call a function like @foo(bar), you are
supressing error messages.

But I have never found out how to *really* use it. Most of the error
messages I get mean that I have to fix something right now once and
for all. Supressing an error message doesn't supress the error. And
this little strudel doesn't seem to do anything useful for me.

So maybe I need to learn something. But I can't find anything in the
PHP docs in regards to it.

Anybody can point me to some useful information on it?
How about here:

http://www.php.net/manual/en/languag...rorcontrol.php

Hope that helps,
Carl.

Apr 27 '07 #2

P: n/a
Rik
Razzbar wrote:
I basically know that when you call a function like @foo(bar), you are
supressing error messages.

But I have never found out how to *really* use it. Most of the error
messages I get mean that I have to fix something right now once and
for all. Supressing an error message doesn't supress the error. And
this little strudel doesn't seem to do anything useful for me.

So maybe I need to learn something. But I can't find anything in the
PHP docs in regards to it.

Anybody can point me to some useful information on it?
There's loads of times user given data can be valid or invalid. While it
can create an error, and you normally want to display and/or log
errors, it can be that a certain action can fail, and you're not
really interested in the error, as it's an error for your user to figure
out, not you.

An example:
For instance, let's say you want to validate the html-code of an url
given to you by the user. Now, the user (accidentally or not) inputs the
wrong url. Let's say you use fopen(); to open the url and get the
contents. Fopen() will generate an error because the url doesn't exist.
This is not your concern however (offcourse you'll have a check that
informs the user your script cannot open the url). Not being able to
open a non-existent url is not something you're interested in, so you
don't want the generated php-error turning up on screen (actually, you
never want that on live servers), and not in your log files. Hence the @.

Well, that's how it could be. Some coders are just sloppy and overly use
@ just to hide the fact that they cannot write a decent piece of code,
and on top of that don't know how to disable error_reporting(). So, I'm
very pleased to so you write "Supressing an error message doesn't
supress the error. And this little strudel doesn't seem to do anything
useful for me." The @ error-supressor has seldom any real use indeed.

--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!
Apr 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.