1

Is there any way I can dump all variables with their values a script has into a file when the script tries to allocate more memory than it is allowed to? For debugging purposes.

php_nub_qq
  • 13,981
  • 19
  • 68
  • 133

1 Answers1

2

You can use this code:

register_shutdown_function('shutdownFunction');
function shutDownFunction() {
    if ($error['type'] == 1) {
        // do your stuff here
    }
} 

It will be called when running into your fatal error.

nl-x
  • 11,501
  • 6
  • 31
  • 58