use register_shutdown_function('exit', 1); instead