What are potential pitfalls of manipulating the HTTP status code in PHP to hide a 404 error?

Manipulating the HTTP status code in PHP to hide a 404 error can lead to misleading users and search engines about the actual status of the requested resource. It is important to handle 404 errors properly to provide a clear indication that the resource is not found. To solve this issue, you should handle 404 errors gracefully by returning the appropriate HTTP status code along with a custom error message.

<?php
header("HTTP/1.0 404 Not Found");
echo "404 Not Found - The requested resource could not be found.";
exit;
?>