Home > Article > Backend Development > Instructions on the role of the at @ symbol in php_PHP tutorial
I believe that many new PHP users like me have been frustrated by this problem when they were learning PHP. What exactly does the @(at) symbol do?
Once, I downloaded someone else's source code and looked at it. I saw countless @ marks, and I thought they were comments at first; later I found that the statements after @ will also be executed. I'm confused, what is this mark for?....
As the study continues to deepen, I finally understand. The function of this mark is somewhat similar to the ignored error "on error resume next" in ASP. Their functions are the same. When the PHP interpreter encounters a statement starting with @, regardless of whether the statement in this line is executed successfully, it will continue to execute subsequent statements without reporting an error. But please note that the @(at) mark only works on the current line.
I hope the question about @(at) ends here.
eg. The following sentence will definitely report an error
Error code
The code is as follows
|
Copy code
|
||||||||||||||||||||||||||||||||
$sql = mysql_connect(*); ?>
However, if we add the @(at) mark, the error will not be reported and execution will continue. No error code
|