public function testExample4() { $function = function () { throw new \Exception(); }; $mock = new Mock(__NAMESPACE__, "time", $function); $mock->enable(); try { time(); } finally { $mock->disable(); } }