I mostly see the response code being set like this:
header(\'HTTP/1.1 404 Not Found\');
But the below also seems to work fine