I've seen Kalle's patch for http://bugs.php.net/bug.php?id=52555.
It actually implements a http_response_code() function to export the
current HTTP response code from SAPI layer to PHP user land.
I'm suggesting to rename that function to get_http_response_code(),
and implement its sister : set_http_response_code().
Something like that should make it :
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE)
sapi_header_op(SAPI_HEADER_SET_STATUS, &code TSRMLS_CC);
That would help changing the http response code.
Actually, that can only be done in weird ways, like <?php header(' ',
null, 301); ?>