4 ms·
It's interesting to find out just how many ways @ is bad but this article is going to fall on deaf ears. The people that can be convinced that it's bad are alr
by juan_juarez 14y ago
It's interesting to find out just how many ways @ is bad but this article is going to fall on deaf ears. The people that can be convinced that it's bad are already not using it. Those that need to be told why the "ignore broken things and keep on trucking" operator is bad, aren't paying attention anyways.
- maratd 14y agoThere are cases where you want something silenced. In my code base, there is one place where it is used and I need it there. I frequently use file_get_contents to retrieve data stored on external servers. If there is a network error or the external service goes down temporarily, it will trigger an error. I don't want my log files flooded with transient error messages that are outside of my control. Instead, I just want it to try again. @ makes this possible.
- pavel_lishin 14y agoWe opt to use the curl functions for that.
- maratd 14y agoI understand that decision, but I actively try to remove any extensions that I can do without to keep the PHP binary slim and even more reliable. My personal way of doing things, that's all. file_get_contents can do everything the curl extensions can, provided that you use the context options, so I just use that and remove curl when I compile the PHP binary.