ID: 39381 Updated by: [EMAIL PROTECTED] Reported By: tikitiki at mybboard dot com -Status: Bogus +Status: Open Bug Type: Unknown/Other Function Operating System: Not Applicable PHP Version: 5.2.0 New Comment:
This one has hit me using the PEAR HTTP_Session class using the PEAR DB driver. No sessions were being stored in the database. Previous Comments: ------------------------------------------------------------------------ [2006-11-13 15:54:00] tikitiki at mybboard dot com C'mon Guys... Hear me out here. The classes in PHP 5.2.0 have been changed to destruct in the reverse order that they've been initialized. Why I ask? I hope the change was not 'just because'. And if the change was intentional, you guys should have known that it would affect many scripts. Does it not make more sense to destruct classes in the order they were initialized in the first place? ------------------------------------------------------------------------ [2006-11-12 16:57:38] rygorde4 at sbcglobal dot net this is a PHP 5.2.0 error which causes the classes to be destructed in the reverse way they are initialized. If this change was intended for PHP 5.2.0, then you should have given us a heads up before you went releasing software that broke a whole ton of scripts. This IS a error on PHP 5.2.0, the PHP team should consider unbogusing the report. ------------------------------------------------------------------------ [2006-11-11 00:58:58] rygorde4 at sbcglobal dot net http://bugs.php.net/bug.php?id=36759 ??? How come it is different in PHP 5.2.0? A lot of programs are corrupt because of this 'change'. Will being able to call register_shutdown_function on __destruct fix this, regardless of php version? ------------------------------------------------------------------------ [2006-11-10 16:15:58] [EMAIL PROTECTED] There is no certain order of object destruction, there never was and this is explained in many other reports. You have to take care of the correct destruction order yourself. ------------------------------------------------------------------------ [2006-11-10 16:08:11] tikitiki at mybboard dot com Reproduce code: --------------- <?php function run_shutdown() { global $x; echo __FUNCTION__."\n"; $x->do_something(); } class Foo { function do_something() { echo "hi\n"; } function __destruct() { echo __METHOD__."\n"; } } class Bar { function __destruct() { run_shutdown(); echo __METHOD__."\n"; } } $y = new Bar(); $x = new Foo(); ?> Expected result: ---------------- Bar::__destruct run_shutdown hi Foo::__destruct Actual result: -------------- Foo::__destruct run_shutdown Fatal error: Call to a member function do_something() on a non-object in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 5 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39381 -- Edit this bug report at http://bugs.php.net/?id=39381&edit=1