; throw new exception(error, 500); // 抛出异常 } public function __destruct() { echo __destruct
; }}$test = new test();$test->test();
方法里抛出异常后,不会调用析构函数:
try异常后能调用析构函数:
start = microtime(true); } public function test() { echo in test()
; try { // try 异常 throw new exception(error, 500); // 抛出异常 } catch(exception $e) { } } public function __destruct() { echo __destruct
; }}$test = new test();$test->test();
