From:             vma1 at abv dot bg
Operating system: Slackware Linux 9.0
PHP version:      5CVS-2003-07-25 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Calling exit() from a destructor breaks next executed script

Description:
------------
When a destructor runs and you call exit() from within it, this will break
the next executed PHP script with a "Cannot redeclare..." message. The bug
appears when the script is run on a web server, not from the command line.
I think that the HTTP request must be 1.1 not 1.0, because for me it
appears only when HTTP request has keepalive connection enabled. To
reproduce the bug, place the following script on a web server and run it
from the web browser (in my case it was Internet Explorer 6.0)

Reproduce code:
---------------
<?
class someclass
{
        public function __destruct ()
        {
                exit ("Here we terminate");
        }
}

header ("Location: http://"; . $_SERVER ["SERVER_NAME"] . $_SERVER
["SCRIPT_NAME"]);
$obj = new someclass;

function evil ()
{
}
?>

Expected result:
----------------
No output is expected. The HTTP request should loop in redirection calls.

Actual result:
--------------
Fatal error: Cannot redeclare evil() (previously declared in :15) in
/usr/local/apache/site/htdocs/bug.php on line 15


-- 
Edit bug report at http://bugs.php.net/?id=24812&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24812&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24812&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24812&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24812&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24812&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24812&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24812&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24812&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24812&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24812&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24812&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24812&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24812&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24812&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24812&r=gnused

Reply via email to