1--TEST-- 2Try catch finally (multi catch blocks with return) 3--FILE-- 4<?php 5 6class AE extends Exception {}; 7class BE extends Exception {}; 8 9function foo () { 10 try { 11 try { 12 try { 13 throw new Exception("try"); 14 } catch (AE $e) { 15 die("error"); 16 } finally { 17 echo "1"; 18 } 19 } finally { 20 echo "2"; 21 } 22 } catch (BE $e) { 23 die("error"); 24 } catch (Exception $e) { 25 echo "3"; 26 } finally { 27 echo "4"; 28 return 4; 29 } 30 return 5; 31} 32 33var_dump(foo()); 34?> 35--EXPECT-- 361234int(4) 37