|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-07-25 07:55 UTC] mark at seventhcycle dot net
Description: ------------ The destructor for any classes I make isn't being called. Here is a diff of my php.ini to the distributed one. /usr/local/lib#> diff php.ini php.ini-dist 120c120 < zlib.output_compression = On --- > zlib.output_compression = Off 293c293 < log_errors = On --- > log_errors = Off 340c340 < error_log = syslog --- > ;error_log = syslog 373c373 < register_globals = On --- > register_globals = Off 952c952 < session.use_trans_sid = 1 --- > session.use_trans_sid = 0 The reproduced code run below is live here: http://seventhcycle.net/php/classtest.php A copy of my phpinfo can be found here: http://seventhcycle.net/php/phpinfo.php Reproduce code: --------------- <?php class MyDestructableClass { function __construct() { print "construct\n"; } function __destruct() { print "destruct"; } } $obj = new MyDestructableClass(); ?> Expected result: ---------------- construct destruct Actual result: -------------- construct PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Interestingly, this follows the same behavior as register_shutdown_function() does in php5, in that it can't send anything out to the browser. php4 can do this, though, and does properly print shutdown information. function shut() { echo "shutting down"; }Sorry, the proper code posted would be: function shut() { echo "shutting down"; } register_shutdown_function("shut"); This prints out properly in php4. Is it a bug in php4, or a change of functionality for php5?