you should verify that $status and $text cannot contain "\r\n" or "\n" to protect against http-header injections