If error_type is E_USER_ERROR then trigger_error throw FATAL ERROR and script stopped after this line.
<?php
$msg = 'This is the test message for echo';
trigger_error('Error message', E_USER_ERROR); // Script stopped after this line...
echo $msg; // This line does not appear...
?>