I've been going through some PHP code for an open source applications and I've been seeing a lot of use of the "@" symbol in front of functions.

For example:

if (!@copy($_FILE['attachment'], $dest)) {
    return $error['failed'];

My question is: what is the "@" symbol in front of the copy function for? I know what the exclamation point is used for, but not the 'at' symbol.

It's not just the copy function that I see it in front of, I've seen it used in front of unlink() (displayed: @unlink($file); ) as well.

Google and the php.net docs don't seem to be able to provide a definitive answer. Can anyone here provide some insight or where to look further?


Recommended Answers

All 4 Replies

Suppresses error reporting.

That's it!? That's the elusive answer? :)

Would it be wise to remove the "@" symbol while debugging then or does it not make a difference?

Thanks for your help! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.