PHP error_reporting(E_ERROR); still shows E_DEPRECATED in PHP 8.1

37 views Asked by At

PHP on command line shows E_DEPRECATED even when error_reporting() has been set to only report E_ERROR.

I have this dummy code:

$prev_level = error_reporting(E_ERROR);
echo $prev_level."\n";
echo error_reporting()."\n";
echo strftime('%Y-%m-%d', time());

which outputs:

32767 
1 
E_DEPRECATED: Function strftime() is deprecated in .......... 
2024-03-06

However, if I completely turn it off with error_reporting(0);, the E_DEPRECATED doesn't show.

My php.ini settings related to errors are:

display_errors => Off => Off
display_startup_errors => On => On
error_append_string => no value => no value
error_log => syslog => syslog
error_prepend_string => no value => no value
error_reporting => 32767 => 32767
html_errors => Off => Off
ignore_repeated_errors => Off => Off
log_errors => On => On

What am I missing?

0

There are 0 answers