mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-28 06:48:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
66 lines
1.8 KiB
XML
66 lines
1.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- splitted from ./en/functions/funchand.xml, last change in rev 1.1 -->
|
|
<refentry id="function.func-num-args">
|
|
<refnamediv>
|
|
<refname>func_num_args</refname>
|
|
<refpurpose>
|
|
Returns the number of arguments passed to the function
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>func_num_args</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Returns the number of arguments passed into the current
|
|
user-defined function. <function>func_num_args</function> will
|
|
generate a warning if called from outside of a user-defined function.
|
|
</simpara>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
function foo() {
|
|
$numargs = func_num_args();
|
|
echo "Number of arguments: $numargs\n";
|
|
}
|
|
|
|
foo (1, 2, 3); // Prints 'Number of arguments: 3'
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<simpara>
|
|
<function>func_num_args</function> may be used in conjunction
|
|
with <function>func_get_arg</function> and
|
|
<function>func_get_args</function> to allow user-defined
|
|
functions to accept variable-length argument lists.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|