Valid use cases for at-sign in php

前端 未结 6 1392
天命终不由人
天命终不由人 2021-01-23 09:16

The at sign is used to hide error messages. As far as I see, there is absolutely no use case or excuse for using it.

  1. You can hide errors in production by changing
6条回答
  •  情话喂你
    2021-01-23 09:37

    • When using DOMDocument, invalid HTML will throw warnings, we don't care on most cases.
    • When using PEAR's Mail, you'll get warnings about functions that shouldn't be called statically, that's because Mail supports PHP 4. These can be safely ignored.
    • When using unlink(), you suppress errors to prevent race conditions.

提交回复
热议问题