您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php析构函数疑惑

2024/3/10 17:09:12发布21次查看
start = microtime(true); } public function test() { echo in test()
; 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();
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product