我想从一个try
块内退出:
function myfunc
{
try {
# Some things
if(condition) { 'I want to go to the end of the function' }
# Some other things
}
catch {
'Whoop!'
}
# Other statements here
return $whatever
}
我用 a 测试过break
,但这不起作用。如果任何调用代码在循环内,它会中断上层循环。