Ok, here is the problem.
I have a server with PHP 5.0.3, running on 2.6.11-gentoo, let's call it server A, and another one with 5.0.4, running on 2.6.10-gentoo-r2, server B.
Here is the code that I run on both:
The output is as follows:
// set error displaying to full
error_reporting(E_ALL | E_STRICT);
echo "OnShutdown function called.\n";
// register this function to be run at script shutdown
// define a class with a destructor
// taken from php.net example for __destruct
print "In constructor\n";
$this->name = "MyDestructableClass";
print "Destroying " . $this->name . "\n";
// create a class
$obj = new MyDestructableClass();
OnShutdown function called.
So, before I panic, what should I check? Is there some setting to disable shutdown functions and destructors? I've found some bugs related to __destruct not called, but it seems all have been fixed quite a while ago, and it works with 5.0.3, but not 5.0.4.
The thing is driving me crazy, specially because some of my new code is using some sort of automated database features with objects inserting/updating/deleting on destruction and I really need this to work.