header_remove() issues (overly aggressive?)

From: Date: Tue, 23 Jun 2009 08:55:30 +0000
Subject: header_remove() issues (overly aggressive?)
Groups: php.internals 
Request: Send a blank email to internals+get-44433@lists.php.net to get a copy of this message
Hi all While documenting header_remove() I was experimenting a little bit.. If an "empty" argument is passed to the function (empty string, null, false,..) the function doesn't do anything, as it checks for ZEND_NUM_ARGS() rather then the length of string.. thats a doc issue or bug? Second, it removes even the X-Powered-By header, is that expected? Third, it removes session and even cookie headers.. bjori@jessica:/usr/src/php/5.3$ sapi/cgi/php-cgi <?php session_start(); session_write_close(); X-Powered-By: PHP/5.3.0RC5-dev Set-Cookie: PHPSESSID=b8g31to001mdfoqq6gg1c90ru2; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html bjori@jessica:/usr/src/php/5.3$ sapi/cgi/php-cgi <?php session_start(); session_write_close(); header_remove(); Content-type: text/html Is that really expected? Just add a big fat warning on the doc page? -Hannes

« previous php.internals (#44433) next »