Skip to content

unregister() does not disable the shutdown function #772

@DvdGiessen

Description

@DvdGiessen

Minimal reproduction:

$whoops = new \Whoops\Run();
$whoops->appendHandler(new \Whoops\Handler\PrettyPageHandler());
$whoops->register();
$whoops->unregister();
throw new Exception();

Opening this page shows the pretty page handler, which is unexpected since unregister() was called. This is happening because the shutdown function is picking up on the unhandled exception error.

Shutdown functions cannot be unregistered (there is no unregister_shutdown_function() in PHP); however they can be disabled by simply not doing anything and returning immediately, which I think would be the right solution here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions