Copied from wiki.php.net, last synchronized Oct 13, 2026 11:52 UTC
In 5.3 we introduced E_DEPRECATED to mark internal functions/classes/syntax elements as deprecated with a separate error level. The same deprecation process applies for user level code. That's why we should introduce E_USER_DEPRECATED similar to the already present user space levels E_USER_WARNING, E_USER_NOTICE and E_USER_ERROR.
<?php
class Foo
{
public function __construct()
{
trigger_error('Use Bar instead', E_USER_DEPRECATED);
}
}
<?php
function do_something()
{
trigger_error('Use do_something_else() instead', E_USER_DEPRECATED);
}
<?php
// MY_FUNKY_LIBRARY
trigger_error('Use non-funky library', E_USER_DEPRECATED);
...