bindTo($this); $closure(); } } $bug = new bug(); $bug->on(function() { throw new \Exception("Exception thrown successfully"); });