Skip to content

Commit

Permalink
Silence the E_USER_ERROR deprecation on 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Oct 27, 2024
1 parent 7a9d85b commit d7ea08d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ trigger_error('Error thrown', E_USER_WARNING);

echo 'Triggering E_USER_ERROR error (unsilenceable on PHP8)' . PHP_EOL;

trigger_error('Error thrown', E_USER_ERROR);
if (PHP_VERSION_ID >= 80400) {
// Silence a deprecation notice on PHP 8.4
// https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
@trigger_error('Error thrown', E_USER_ERROR);
} else {
trigger_error('Error thrown', E_USER_ERROR);
}
?>
--EXPECT--
Triggering E_USER_NOTICE error
Expand Down

0 comments on commit d7ea08d

Please sign in to comment.