Valid use cases for at-sign in php

前端 未结 6 1391
天命终不由人
天命终不由人 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:34

    In most cases you should indeed not use it. Some cases it makes sense though:

    • unlink()
    • while (@ob_end_flush());

    There might be some other edge cases, but besides these you should really never ever supress errors.

提交回复
热议问题