Skip to content

restore_xxx_handler() does silently return even if there is no handler to restore #12971

@mvorisek

Description

@mvorisek

Description

The following code:

repro: https://3v4l.org/DDulh

<?php

restore_error_handler();
restore_error_handler();
restore_error_handler();

restore_exception_handler();
restore_exception_handler();
restore_exception_handler();

Resulted in this output:

But I expected this output instead:

php warning for each restore_xxx_handler() call if there is no handler to restore

The warnings are important to be inform the developer the operation is probably not wanted (ie. handler was never added).

PHP Version

any

Operating System

any

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions