Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55646 invoked from network); 28 Mar 2008 00:20:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Mar 2008 00:20:21 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2034] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/5B-27384-2C93CE74 for ; Thu, 27 Mar 2008 19:20:21 -0500 Received: (qmail 32276 invoked by uid 98); 28 Mar 2008 00:20:21 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.01 (clamdscan: 0.88.7/6421. Clear:RC:1(127.0.0.1):. Processed in 0.079402 secs); 28 Mar 2008 00:20:21 -0000 Received: from localhost (HELO www.l-i-e.com) (127.0.0.1) by localhost with SMTP; 28 Mar 2008 00:20:21 -0000 Received: from 98.193.37.55 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Thu, 27 Mar 2008 19:20:21 -0500 (CDT) Message-ID: <41516.98.193.37.55.1206663621.squirrel@www.l-i-e.com> In-Reply-To: <47EC2065.2000002@peytz.dk> References: <47EC2065.2000002@peytz.dk> Date: Thu, 27 Mar 2008 19:20:21 -0500 (CDT) To: "Christian Schmidt" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] [PATCH] Allow unsetting headers previously set by header() From: ceo@l-i-e.com ("Richard Lynch") On Thu, March 27, 2008 5:32 pm, Christian Schmidt wrote: > When a header has been set using header('Foo: bar') it can be replaced > with > other headers, but it cannot be removed. I like the idea of being able to "unset" headers. I'm not sure I like the idea of calling what looks lik an invalid header() to unset one... One might envision a future PHP that would want to, for example, say: "Invalid header: Header must start with [A-Z]:" for somebody who does: header($foo); where $foo is some random typo string that's not a header at all. At the risk of incurring the wrath of everybody else, I'd prefer to see a new function like header_unset (or unset_header) to "undo" a header. Some questions I'd have about functionality: If a header was not set, and then you unset it, is that an error or E_NOTICE or anything? If you try to unset a header after the headers have gone out, presumably the same nifty message about WHERE the header was set would be output. But then to be truly pedantic, what if you unset a header that was never set in the first place, after the headers have gone out? Is this an error or any kind? Just trying to anticipate all the edge cases. :-) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So?