Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 22484

Can I enable exceptions on warnings in production?

$
0
0

Just like in debug mode, I'd like Symfony to catch any notice or warning in my prod environment, and convert it to an exception.

Can I do this without enabling the whole debug mode?

Take the following code for example, that generates a PHP warning:

$x = null;dump($x['foo']);

With APP_DEBUG=1, the warning is converted to an exception:

ErrorException: Warning: Trying to access array offset on null

Whereas with APP_DEBUG=0, the warning is silently discarded:

^ null

I'd like Symfony to convert the warning to an exception even when APP_DEBUG=0.


Viewing all articles
Browse latest Browse all 22484

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>