PHP 引数があったらそっち使うかな。

2010年07月29日(木)

よくこのシチュエーションに出くわすのですが
なにか一般的な方法があるんでしょうか?

function test(){
  $args=func_num_args();
  $test_var='戻る';
  if(isset($args[0])) $test_var=$args[0];
}