From:             webmaster at benliles dot com
Operating system: Slackware 10 and Solaris
PHP version:      5.0.3
PHP Bug Type:     Zend Engine 2 problem
Bug description:  PHP claims that headers are set when __destruct is called

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 bug report at http://bugs.php.net/?id=32406&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32406&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32406&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32406&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32406&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32406&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32406&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32406&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32406&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32406&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32406&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32406&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32406&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32406&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32406&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32406&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32406&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32406&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32406&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32406&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32406&r=mysqlcfg

Reply via email to