くだすれPHP(超初心者用)5at PHP
くだすれPHP(超初心者用)5 - 暇つぶし2ch710: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