trigger_error()
trigger_error() is a PHP native function, which raises an error, in the style of PHP engine. It can raise notice, warning, deprecated and error.
<?php
echo $a;
trigger_error('This is a warning, that says: Undefined variable $x', E_USER_WARNING);
?>