In PHP, the role of the '@' prefix is ​​to suppress error reporting

WBOY
Release: 2023-08-20 22:10:02
forward
1787 people have browsed it

In PHP, the role of the @ prefix is ​​to suppress error reporting

The '@' symbol prevents errors from being displayed on the screen.

PHP supports the error control operator, the symbol (@). When it is prepended to a PHP expression, error messages that may be generated using this expression will be ignored.

If the track_errors attribute is enabled, the error messages generated by this expression will be saved in a variable named $php_errormsg. This variable is overwritten every time an error occurs.

It is recommended to write code related to error status/condition.

The above is the detailed content of In PHP, the role of the '@' prefix is ​​to suppress error reporting. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!