2009-11-21 68 views
0

我可以合併PHP中的兩個捕獲嗎?PHP:合併捕獲

try { 
    // some code 
} 
catch (App_Exception $e) { 
    // do sth. 
} 
catch (Exception $e) { 
    // do the same exception code again 
} 

回答

0
try { 
    try { 
     // some code 
    } 
    catch (App_Exception $e) { 
     // do sth. 
     throw $e; 
    } 
} 
catch (Exception $e) { 
    // do the same exception code again 
} 
+0

我沒有得到這個在所有但如何改變行爲? – 2009-11-21 20:55:55