Posted on

My list of PHP language features with hard-to-imagine-use-cases: #1 – The @ symbol that supresses errors

I’ll preface this post by saying that the hours spent chasing bugs after 1AM are seldom remembered fondly. So perhaps that’s causing some bias in my opinion – bear it in mind.

I’m really learning PHP as I go along, so you can imagine my suprise when at 3AM I discovered the reason I wasn’t seeing an out of memory error was because in PHP:

@<any statement></any>

is the same as an empty try/catch:

try {
   <any statement>
} catch {}</any>

Continue reading My list of PHP language features with hard-to-imagine-use-cases: #1 – The @ symbol that supresses errors