Posted on 2006-09-20 10:20
my 閱讀(219)
評論(0) 編輯 收藏 所屬分類:
php5
例子 20-1. 拋出一個異常
<?php
try { ??
$error
=
'Always throw this error'
; ?? throw new
Exception
(
$error
);
??
echo
'Never executed'
;
} catch (
Exception $e
) { ?? echo
'Caught exception: '
,?
$e
->
getMessage
(),
"\n"
; }
echo
'Hello World'
;
?>
|