Never mind. I checked the source and saw what I was looking for (that the handler also preserves the object instance and not just the method itself).
I applied your patch. Thanks.


At 11:34 PM 4/3/2004 +0200, Timm Friebe wrote:
On Sat, 2004-04-03 at 21:26, Andi Gutmans wrote:
> In general, I have no problem with adding this consistency.
> Where is a reference to $instance held until the exception occurs?

What kind of reference?

This is what I used to verify the (instance) functionality:

<?php
  class ExceptionHandler {
    protected
      $prefix   = '*** Uncaught exception';

    public function handle($e) {
      printf(
        "%s: %s (%s)\n",
        $this->prefix,
        get_class($e),
        $e->getMessage()
      );
    }
  }

  $handler= new ExceptionHandler();
  set_exception_handler(array($handler, 'handle'));
  throw(new Exception('Test'));
?>

Output:
*** Uncaught exception: exception (Test)

- Timm

-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to