while waiting to correct the problems (there may be many) it is possible to define a custom error handling function to ignore them.
For exemple :
error_reporting(E_ALL) ;
set_error_handler(
function($severity, $message, $file, $line) {
if ( !$severity || error_reporting()!=E_ALL ) return ; // to treat @ before functions
$erreurs_autorisees = array(
E_NOTICE => "Notice",
E_USER_NOTICE => "User Notice",
E_DEPRECATED => "Deprecated",
E_USER_DEPRECATED => "User Deprecated",
E_WARNING => "Warning",
E_USER_WARNING => "User Warning",
) ;
if ( isset($erreurs_autorisees[$severity]) ) {
$warning_autorises = [
"addslashes(): Passing null to parameter #1 (\$string) of type string is deprecated",
"base64_decode(): Passing null to parameter #1 (\$string) of type string is deprecated",
"htmlspecialchars(): Passing null to parameter #1 (\$string) of type string is deprecated",
"mb_decode_mimeheader(): Passing null to parameter #1 (\$string) of type string is deprecated",
"mysqli_real_escape_string(): Passing null to parameter #2 (\$string) of type string is deprecated",
"preg_replace(): Passing null to parameter #3 (\$subject) of type array|string is deprecated",
"preg_split(): Passing null to parameter #3 (\$limit) of type int is deprecated",
"rawurlencode(): Passing null to parameter #1 (\$string) of type string is deprecated",
"setcookie(): Passing null to parameter #2 (\$value) of type string is deprecated",
"str_starts_with(): Passing null to parameter #1 (\$haystack) of type string is deprecated",
"strcmp(): Passing null to parameter #1 (\$string1) of type string is deprecated",
"strlen(): Passing null to parameter #1 (\$string) of type string is deprecated",
"strtr(): Passing null to parameter #1 (\$string) of type string is deprecated",
"strpos(): Passing null to parameter #1 (\$haystack) of type string is deprecated",
"substr(): Passing null to parameter #1 (\$string) of type string is deprecated",
"trim(): Passing null to parameter #1 (\$string) of type string is deprecated",
"strncasecmp(): Passing null to parameter #1 (\$string1) of type string is deprecated",
] ;
if ( in_array($message, $warning_autorises) ) return true ;
// On ne converti pas les warning en Exception, on se contente de les logger / les afficher
$msg = $erreurs_autorisees[$severity].": $message in $file on line $line" ;
if ( ini_get('display_errors') ) echo $msg ;
// @error_log($msg) ; // if you want to log
}
else throw new ErrorException($message, 0, $severity, $file, $line) ;
return true;
}
);