2月 102010
 

以下のような表記の場合、第二引数を省略しても、
第二引数には、$b=0という初期値が使用される。
function kansu_name($a,$b=0);
ただし、以下のように、初期値が設定されていない場合は、引数が必須となる。
function kansu_name($a,$b);
・引数が必須の場合も、引数を省略してもエラーが出ない場合もあるが、環境によってはエラーが出るので、
引数を省略するのはだめ。

よく読まれている記事

この記事を読んだ人は次の記事も読んでいます:

このエントリーをはてなブックマークに追加
はてなブックマーク - php 関数 引数の省略
[`google_buzz` not found]
[`yahoo` not found]
[`livedoor` not found]
[`friendfeed` not found]
[`tweetmeme` not found]
[`grow` not found]
[`evernote` not found]

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)