ID: 39381 User updated by: rygorde4 at sbcglobal dot net Reported By: rygorde4 at sbcglobal dot net Status: Bogus Bug Type: Unknown/Other Function Operating System: Not Applicable PHP Version: 5.2.0 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2006-11-09 02:37:47] Nikolas dot hagelstein at gmail dot com Same at wordpress 2.05 using php5.2: PHP Fatal error: Call to a member function get() on a non-object in /var/www/www.trashboard.de/htdocs /wp-includes/cache.php on line 28 Reverting to 5.1.6 made it work again ------------------------------------------------------------------------ [2006-11-08 13:44:38] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ 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