PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
caseymanus
Forum Commoner
Posts: 34 Joined: Wed Nov 20, 2002 10:32 pm
Contact:
Post
by caseymanus » Wed Jan 22, 2003 10:58 am
in the following code block
Code: Select all
@$result = odbc_exec($db, $sqlstm);
if (!$result) { // log errors
fputs($log, $line, 3000);}
What does the @ symbol do in front of the variable $result ?
mydimension
Moderator
Posts: 531 Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:
Post
by mydimension » Wed Jan 22, 2003 11:02 am
it hides all error reporting from that line of code. normally you will see the @ symbol preceeding a function name but it works either way.
caseymanus
Forum Commoner
Posts: 34 Joined: Wed Nov 20, 2002 10:32 pm
Contact:
Post
by caseymanus » Wed Jan 22, 2003 12:53 pm
Thanks dimension....you the man!
Rob the R
Forum Contributor
Posts: 128 Joined: Wed Nov 06, 2002 2:25 pm
Location: Houston
Post
by Rob the R » Wed Jan 22, 2003 12:59 pm
I was going to post a link to the relevant section of the PHP manual, but I could not find it. Does anyone know where this is explained in the
PHP manual ?
caseymanus
Forum Commoner
Posts: 34 Joined: Wed Nov 20, 2002 10:32 pm
Contact:
Post
by caseymanus » Wed Jan 22, 2003 1:08 pm
I looked but couldnt find it in the manual. I also looked at my one reference book for PHP...not there either. Maybe an undocumented feature?
Rob the R
Forum Contributor
Posts: 128 Joined: Wed Nov 06, 2002 2:25 pm
Location: Houston
Post
by Rob the R » Wed Jan 22, 2003 4:33 pm
I found the section of the manual this is in. The "@" symbol is actually a unary operator, so it's listed under
Error Control Operator .
evilcoder
Forum Contributor
Posts: 345 Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia
Post
by evilcoder » Wed Jan 22, 2003 4:38 pm
Of coarse. Dim said it was an error control operator, so that should have been clear...... shouldnt it?
Rob the R
Forum Contributor
Posts: 128 Joined: Wed Nov 06, 2002 2:25 pm
Location: Houston
Post
by Rob the R » Wed Jan 22, 2003 4:49 pm
It would have been clear had he actually said that.
it hides all error reporting from that line of code. normally you will see the @ symbol preceeding a function name but it works either way.
The
error reporting section of the PHP manual makes no reference to the "@" sign. That's OK, though. It let me exercise my internet sleuthing skills.
evilcoder
Forum Contributor
Posts: 345 Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia
Post
by evilcoder » Wed Jan 22, 2003 4:55 pm
well at least you found some joy in it.
mydimension
Moderator
Posts: 531 Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:
Post
by mydimension » Wed Jan 22, 2003 10:00 pm