public function testCustomErrorHandler() { $this->expectException('Exception'); $this->sandbox->setErrorHandler(function ($errno, $errstr) { throw new \Exception($errstr); }); $this->sandbox->execute(function () { $a[1]; }); }