Reputation: 8627
Is there a simple way to trigger PHP shutdown so that error_get_last
function returns a real error from within a function registered with register_shutdown_function
. I need it to test my custom error handling and mailing functions under stress conditions.
Upvotes: 3
Views: 1237
Reputation: 6249
<?php
function shutdown()
{
echo "shutdown:\n";
print_r(error_get_last());
}
register_shutdown_function('shutdown');
throw new Exception("fatal error");
print("END")
Upvotes: 1