PHP関数で新しい例外をスローしようとしましたが、エラーメッセージがエコーされません。代わりに通常のエコーを使用することもできましたが、実際に違いを確認したいと思います。このコードの何が問題なのか教えてください。
function searchMovie($movieName){
if (!isset($movieName))
throw new Exception('missing movie name');
//execute
//return something here
}
//call the function
echo searchMovie('iron man'); //this gives a result.
echo searchMovie(); //this does not echo the 'missing movie name'
ありがとう。私のような初心者のための助けは本当にありがたいです.