ID:               32406
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webmaster at benliles dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
-Operating System: Slackware 10 and Solaris
+Operating System: *
-PHP Version:      5.0.3
+PHP Version:      5.*
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

__destruct is called during script shut down - that is everything has
already been sent. Add a '$test = NULL;' in front of the '?>' and
you'll see.


Previous Comments:
------------------------------------------------------------------------

[2005-03-22 00:16:31] webmaster at benliles dot com

Description:
------------
It appears that PHP has a flag set for headers already being sent when
__destruct() is called despite the fact that nothing is being sent
before that.  This has been seen in PHP 5.0.2 and PHP 5.0.3 with two
different operating systems.  This is not documented as claimed in an
earlier bug report.

Reproduce code:
---------------
<?
class letsTestThis {

 public function __destruct() {
  if (!headers_sent($file,$line)) {
   header("Content-type: text/xml");
   echo "Some cool XML!";
  } else {
   echo "Headers already sent in file: ".$file."<BR>\nOn Line:
".$line."<BR>\n";
  }
 }
}

$test = new letsTestThis();
?>

Expected result:
----------------
Some cool XML



Actual result:
--------------
Headers already sent in file: 
On Line: 0


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32406&edit=1

Reply via email to