From:             alex at weej dot com
Operating system: GNU Linux
PHP version:      5.0.5
PHP Bug Type:     Feature/Change Request
Bug description:  headers_list functionality regression

Description:
------------
The documented behaviour is exactly what I need for a project I am working
on, but now the behaviour has changed (even though the docs haven't yet).
:(

As far as I can see, there is no way to tell what headers PHP is sending
and their values, now.

apache_response_headers() is /not/ a replacement, as it omits Content-Type
(the most important header in my situation) and processes the headers PHP
passes to it. I really don't want to resort to wrapper functions to
maintain my own list. The documentation describes EXACTLY the
functionality I want.

I am upset! :(

http://uk.php.net/manual/en/function.headers-list.php

Reproduce code:
---------------
<?php

/* setcookie() will add a response header on its own */
setcookie('foo', 'bar');

/* Define a custom response header
   This will be ignored by most clients */
header("X-Sample-Test: foo");

/* Specify plain text content in our response */
header('Content-type: text/plain');

/* What headers are going to be sent? */
var_dump(headers_list());

?>

Expected result:
----------------
array(4) {
  [0]=>
  string(29) "X-Powered-By: PHP/5.0.0"
  [1]=>
  string(19) "Set-Cookie: foo=bar"
  [2]=>
  string(18) "X-Sample-Test: foo"
  [3]=>
  string(24) "Content-type: text/plain"
}

Actual result:
--------------
array(4) {
  [0]=>
  string(12) "X-Powered-By"
  [1]=>
  string(10) "Set-Cookie"
  [2]=>
  string(13) "X-Sample-Test"
  [3]=>
  string(12) "Content-Type"
}

-- 
Edit bug report at http://bugs.php.net/?id=34895&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34895&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34895&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34895&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34895&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34895&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34895&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34895&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34895&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34895&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34895&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34895&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34895&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34895&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34895&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34895&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34895&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34895&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34895&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34895&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34895&r=mysqlcfg

Reply via email to