くだすれPHP(超初心 ..
[2ch|▼Menu]
710:nobodyさん
09/02/08 19:09:17
<?php
try {
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");

fntest();
function fntest() {echo "call function";}

} catch (ErrorException $exception){
echo "何かエラーだよ<br />";
echo $exception->getMessage()."<br />";
echo "line:".$exception->getline();
exit();
}
?>
これを実行するとFatal error: Call to undefined function fntest() in〜と出ます
定義を先にするかtry〜catchをなくすとエラーは出ません
何がいけないんでしょうか



次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5345日前に更新/180 KB
担当:undef