How to disable deprecated errors in php

Red Squirrel

No Lifer
May 24, 2003
67,395
12,142
126
www.anyf.ca
I have an older version of phpmyadmin running on my development server and every now and then I get a bunch of notices of something deprecated and if I hit refresh it's gone.

I am trying to just suppress these completely but so far nothing seems to be working. As a debug measure I have the following code in index.php:


Code:
//error_reporting(E_ALL & ~E_NOTICE);

//error_reporting( E_ALL & ~E_DEPRECATED & ~E_NOTICE);

error_reporting(0);

echo($test);//debug

1 ? 2 : 3 ? 4 : 5; //debug

Despite even turning errors completely off I am still getting notices for deprecated code. (the last debug line)

I don't want to modify anything in php.ini since for development reasons I have all errors, warnings etc turned up on that server, but for this particular script I just want them off. I know the error_reporting function is working because I can suppress the notices (uninitialized variable $test) but for some reason it's not working for deprecated. Any way to turn deprecated warnings off 100%?

Server is running Devuan with PHP 7.4.
 

Red Squirrel

No Lifer
May 24, 2003
67,395
12,142
126
www.anyf.ca
Figured it out, turns out for that specific parameter you can't do it through the php script, only via php.ini or .htaccess. I just turned off error reporting for that folder in .htaccess and it fixed it.