★ wanayoo — archive 1999 http://www.php.net/manual/ja/function.func-num-args.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to その他
Quick Reference
English version of this pageGerman version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
その他
* connection_aborted
* connection_status
* connection_timeout
* define
* defined
* die
* eval
* exit
* func_get_arg
* func_get_args
* func_num_args
* function_exists
* get_browser
* ignore_user_abort
* iptcparse
* leak
* pack
* register_shutdown_function
* serialize
* sleep
* uniqid
* unpack
* unserialize
* usleep
* highlight_string
* highlight_file
* show_source
Manual: func_num_args
View the source code for this pageSearch the site



Previous page
 func_get_args
 Updated
Mon, 14 Aug 2000
function_exists 
Next page


func_num_args

(PHP4 >= 4.0b4)

func_num_args -- 関数に渡された引数の数を返す

説明

int func_num_args (void )

カレントのユーザ定義関数に渡された引数の数を返します。 func_num_args()は関数定義部以外でコールされた 場合に警告を発生します。


<?php
function foo() {
   $numargs = func_num_args();
   echo "Number of arguments: $numargs\n";
} 
 
foo( 1, 2, 3 );  // 'Number of arguments: 3'を出力します。
?>
      

func_num_args()func_get_arg() およびfunc_get_args()と組み合わせて使用され、 ユーザ定義関数において可変長の引数リストを使用することができるようになります。

注意: この関数はPHP4で追加されました。


User Contributed Notes: func_num_args


Jamie_Whitham@palmtopsoftware.com
28-Dec-1999 04:59
func_num_args() seems to be returning 14318520 when I am only passing 11 arguments to my function. Is this a bug? Or am I doing something wrong? PHP4 beta 3 Win32


jm-boucher@bigfoot.com
15-Apr-2000 04:42
have tryed this sample, works fine on win32 with php4b1 but won't work on Linux Redhat 6.1 with php4RC1
Fatal error: func_num_args(): Can't be used as a function parameter in /www/htdocs/test.php on line 3

any idea ????!!!!




15-May-2000 12:55
I also get a:
Fatal error: func_num_args(): Can't be used as a function parameter in [...]


Any suggestion?



 About Notes


Previous page
 func_get_args
 Updated
Mon, 14 Aug 2000
function_exists 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.