# Bus Error with restore_error_handler() in destructor

- Thread: https://externals.io/message/9821
- Original archive: https://news-web.php.net/php.internals/9821
- Started by Timm Friebe on 2004-05-11T18:28:05+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #9821 — Timm Friebe — 2004-05-11T18:28:05+00:00

URL: https://externals.io/message/9821#9821

thekid@friebes:~/devel/php/tests > cat tick.php 
<?php
  class ErrorHandler {
    function __construct() {
      set_error_handler(array(&$this, 'handle'));
    }
    
    function __destruct() {
      `restore_error_handler()`;
    }

    function handle($code, $msg, $file, $line, $locals) { 
    }
  }
  
  new ErrorHandler();
?>
thekid@friebes:~/devel/php/tests > php-dev tick.php 
Bus error (core dumped)

- Timm
