#29756 [Fbk->NoF]: __destruct called twice with ze1_compatibility_mode = On
| From: | php-bugs at lists dot php dot net | Date: | Wed, 20 Oct 2004 23:00:20 +0000 |
| Subject: | #29756 [Fbk->NoF]: __destruct called twice with ze1_compatibility_mode = On | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67851@lists.php.net to get a copy of this message | ||
ID: 29756
Updated by: php-bugs@lists.php.net
Reported By: hfuecks at phppatterns dot com
-Status: Feedback
+Status: No Feedback
Bug Type: Zend Engine 2 problem
Operating System: All
PHP Version: 5.0.1
New Comment:
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2004-10-13 09:23:00] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2004-10-13 06:02:52] php at bobsilva dot com
This is fixed in 5.1 CVS
------------------------------------------------------------------------
[2004-08-21 21:14:53] hfuecks at phppatterns dot com
Updating OS to "All" (daringly)
------------------------------------------------------------------------
[2004-08-21 21:10:01] hfuecks at phppatterns dot com
Definately not specific to Windows; checked this out on Linux (Gentoo,
2.4 kernel, PHP 5.0.1) - exactly the same problem.
------------------------------------------------------------------------
[2004-08-19 14:16:54] hfuecks at phppatterns dot com
Description:
------------
Using unmodified copy on php.ini-recommended (no extensions loaded
etc.). Able to reproduce this problem with the Apache SAPI, CLI and CGI
SAPIs.
With zend.ze1_compatibility_mode = On class destructors get called
twice, once directly after the constructor.
With zend.ze1_compatibility_mode = Off (no other modifications to
runtime) problem disappears (destructor called correctly).
This seems to have been reported before (not enough info):
http://bugs.php.net/bug.php?id=27698
Have yet to confirm whether this in Windows specific (more from Linux
when I get there...)
Reproduce code:
---------------
<?php
class Test {
function __construct() {
echo __METHOD__."\n";
}
function someMethod() {
echo __METHOD__."\n";
}
function __destruct() {
echo __METHOD__."\n";
var_dump(debug_backtrace());
}
}
$T = new Test();
$T->someMethod();
?>
Expected result:
----------------
Test::__construct
Test::someMethod
Test::__destruct
array(1) {
[0]=>
array(4) {
["function"]=>
string(10) "__destruct"
["class"]=>
string(4) "Test"
["type"]=>
string(2) "::"
["args"]=>
array(0) {
}
}
}
Actual result:
--------------
Test::__construct
Test::__destruct
array(2) {
[0]=>
array(5) {
["file"]=>
string(20) "D:\php\test\test.php"
["line"]=>
int(18)
["function"]=>
string(10) "__destruct"
["class"]=>
string(4) "Test"
["type"]=>
string(2) "::"
}
[1]=>
array(3) {
["file"]=>
string(20) "D:\php\test\test.php"
["line"]=>
int(18)
["function"]=>
string(7) "unknown"
}
}
Test::someMethod
Test::__destruct
array(1) {
[0]=>
array(4) {
["function"]=>
NULL
["class"]=>
string(4) "Test"
["type"]=>
string(2) "::"
["args"]=>
array(0) {
}
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29756&edit=1