From: Operating system: Linux PHP version: Irrelevant Package: Output Control Bug Type: Bug Bug description:header() replace param works strange
Description: ------------ 1) Output m headers with the same name using header($header, false) 2) Output n (n > m) headers with the same name using header($header, true) Result) headers will not be replaced totally. Script will send to output m last headers sent by header($header, true). Test script: --------------- <?php /** * PHP VERSION 5.3.0 */ header('Set-Cookie: name1=; path=/; domain=.simple.ru', false); header('Set-Cookie: name2=; path=/; domain=.simple.ru', false); header('Set-Cookie: name3=; path=/; domain=.simple.ru', true); header('Set-Cookie: name4=; path=/; domain=.simple.ru', true); header('Set-Cookie: name5=; path=/; domain=.simple.ru', true); print_r(headers_list()); ?> Expected result: ---------------- Array ( [0] => Set-Cookie: name5=; path=/; domain=.simple.ru ) Actual result: -------------- Array ( [0] => Set-Cookie: name4=; path=/; domain=.simple.ru [1] => Set-Cookie: name5=; path=/; domain=.simple.ru ) -- Edit bug report at http://bugs.php.net/bug.php?id=52272&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52272&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52272&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52272&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52272&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52272&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52272&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52272&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52272&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52272&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52272&r=support Expected behavior: http://bugs.php.net/fix.php?id=52272&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52272&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52272&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52272&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52272&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52272&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52272&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52272&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52272&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52272&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52272&r=mysqlcfg