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

PHP Home Page

Manual Table of Contents
Up to Máshova nem sorolható
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageItalian version of this pageFrench version of this page
Máshova nem sorolható
* 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
Sat, 12 Aug 2000
function_exists 
Next page


func_num_args

(PHP4 >= 4.0b4)

func_num_args --  Returns the number of arguments passed to the function

Description

int func_num_args (void )

Returns the number of arguments passed into the current user-defined function. Func_num_args() will generate a warning if called from outside of a function definition.


<?php
function foo() {
    $numargs = func_num_args();
    echo "Number of arguments: $numargs\n";
} 

foo (1, 2, 3);  // Prints 'Number of arguments: 3'
?>
      

Func_num_args() may be used in conjunction with func_get_arg() and func_get_args() to allow user-defined functions to accept variable-length argument lists.

Megjegyzés: This function was added in PHP 4.


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
Sat, 12 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.