4 ms·
> The @ operator no longer silences fatal errors Interesting. There are still some legitimate (well, “legitimate”) use cases for that behavior e.g. with PHP’s
by cdubzzz 7y ago
> The @ operator no longer silences fatal errors
Interesting. There are still some legitimate (well, “legitimate”) use cases for that behavior e.g. with PHP’s native XML extensions.
- treve 7y agoAre you sure those are _fatal_ errors?
- scandinavian 7y agohttps://3v4l.org/saHj2 https://3v4l.org/saHj2 However you could just catch Exception. Not sure why a parse error is a "Fatal error".
- gnud 7y agoA PHP parse error (of your code) is a fatal error. A xml parsing error in the SimpleXmlElement constructor is not a fatal error - it throws an exception. An uncaught exception is a fatal error.