How do I disable error suppression "@" operator in PHP?

482 Views Asked by At

I have a code which was written recklessly (by previous devs ofc) and the error suppression operator "@" was used generously all over the place. And now that I have to debug an error, it is proving a real PITA.

I have tried the regulars like setting error_reporting and display_errors but still error suppression is honoured (maybe it is how its supposed to be).

I have also thought of using a search and replace using regex but I have kept it for last resort.

Now my question is, Is there a way I can override the error suppression operator?

2

There are 2 best solutions below

0
Mohd Abdul Mujib On BEST ANSWER

OK, This is a life saver, If you have xdebug installed there is a flag which does exactly that, it suppresses the error suppressor :) Effectively making it easier to debug this hell of a code.

xdebug.scream=1
8
AudioBubble On

if you want to remove all the error suppressors and at the same time some bad practice about the abuse of the error suppressor ....

you need use your code editor and replace all '@$' in your code and wala you going get all error tracer... you need and not need, and go to debug.