You said you added the code in front of the file.
In the wp-config.php I’m working with there’s this line towards the end:
define('WP_DEBUG', false);
if your config file sets it to true first
and then to false
the problem could be that the last entry wins.