14
ragnex
4y

The project which I took over from the previous team had exactly 1576 usages of an operator which I've never seen before after 10+ years of working in PHP.

Curiosity lead me to the php.net site to see what kind of advanced magic this operator does - only to discover that it's an error suppressing operator (@). They've simply used it as a default method for solving bugs and removing errors from the logs.

Comments
  • 6
    Behind the scenes magic 😂
  • 7
    There are times @ May be required, but it's very rare. Usually only found in the wild with unlink() where a file may not exist so it's not the end of the world deleting nothing.
    But to have a code base riddled with it... that's fucking scary to know.
  • 1
    Didn't know it either. Have been doing PHP development for a long time. There where some specific warnings that I suppressed in Perl in similar fashion as @C0D4 mentioned.

    Also saw a colleague abuse the error_reporting() function. Corrected him directly even though he was senior. You should probably check for that too.
    My condolences on your codebase
  • 0
    Have fun
Add Comment