Is the @ suppression error in workerman source code simpler than the empty callback of set_error_handler ()?

searched the workerman source code and found that set_error_handler (); is used in many places to handle exception errors, but the callback is an empty function.

such as the following code:

set_error_handler(function(){});
fclose($this->_socket);
restore_error_handler();

does it feel more concise to directly use @ to suppress errors?

@fclose($this->_socket);
Jul.07,2021
Errors suppressed by

@ will still be caught by the function set by set_error_handler.
developers like to integrate workerman with other frameworks, and other frameworks usually use the set_error_handler function to catch errors.
causes errors in workerman to be suppressed by @ but still caught by other frameworks. In order to avoid causing trouble to developers, workerman uses set_error_handler to discard some predictable warning


clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb44a7-24ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb44a7-24ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?