Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E_USER_ERROR Is Deprecated

The PHP native constant E_USER_ERROR is deprecated. It should not be used anymore with the trigger() function, nor anywhere else in the code. It shall be removed entirely in PHP 9.

PHP code

<?php

trigger_error('user error', E_USER_ERROR);

?>

Before

PHP Deprecated:  Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead

Deprecated: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead
PHP Fatal error:  user error

Fatal error: user error

After

PHP Fatal error:  user error

Fatal error: user error

PHP version change

This behavior changed in 8.5.

Error Messages

Analyzer

© 2023-2026, Damien Seguy - Exakat