[php-src] Issue #12971: `restore_xxx_handler()` does silently return even if there is no handler to restore
| From: | mvorisek | Date: | Mon, 18 Dec 2023 18:15:08 +0000 |
| Subject: | [php-src] Issue #12971: `restore_xxx_handler()` does silently return even if there is no handler to restore | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246071@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12971
Author: mvorisek
### Description
The following code:
repro: https://3v4l.org/DDulh
```php
<?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