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:
PHP Code:
<?php
// set error displaying to full
error_reporting(E_ALL E_STRICT);
ini_set('display_errors'true);

function 
OnShutdown()
{
  echo 
"OnShutdown function called.\n";
}

// register this function to be run at script shutdown
register_shutdown_function('OnShutdown');

// define a class with a destructor
// taken from php.net example for __destruct
class MyDestructableClass
{
  function 
__construct()
  {
    print 
"In constructor\n";
    
$this->name "MyDestructableClass";
  }
  
  function 
__destruct()
  {
    print 
"Destroying " $this->name "\n";
  }
}

// create a class
$obj = new MyDestructableClass();
?>
The output is as follows:
Server A:
Code:
In constructor
OnShutdown function called.
Destroying MyDestructableClass
Server B:
Code:
In constructor
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.

HELP!