Re: Please help document headers_sent()

From: Date: Wed, 06 Nov 2002 22:55:56 +0000
Subject: Re: Please help document headers_sent()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-90589@lists.php.net to get a copy of this message
Hi Philip, I think the idea is that you do this: if (headers_sent($file, $line)) { echo "headers were sent by $file:$line"; } Both $file and $line are optional. --Wez. On 06/11/02, "Philip Olson" <philip@cornado.com> wrote: > Hello- > > headers_sent() has two new parameters as of PHP > 4.3.0, these are passed in by reference. I see > no need to have to do: > > $file = 'file.php'; > $line = 4; > > headers_sent($file, $line); > > When one could simply do this: > > headers_sent('file.php', 4); > > But we can't, we get this error: > > Fatal error: Only variables can be passed by reference > > This doesn't seem important, forcing one to use > variables here seems odd, why? Yes & is in the > proto but afaict it shouldn't be. > > On a related note, I tried and failed to return > anything other then 1 while using these optional > parameters. I can't even tell if it's reading > the file. If someone could explain a little more > that would be very cool. > > Regards, > Philip > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.dev (#90589) next »