php-doc-en/reference/var/functions/is-callable.xml
Philip Olson c428dd77e8 Initial documentation, leaving commented out for now until confirmed.
Deals with bug #20216 as per Leon's request.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@104687 c90b9560-bf6c-de11-be94-00142212c4b1
2002-11-18 07:59:04 +00:00

91 lines
2.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.87 -->
<refentry id="function.is-callable">
<refnamediv>
<refname>is_callable</refname>
<refpurpose>
Find out whether the argument is a valid callable construct
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>is_callable</methodname>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>syntax_only</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>callable_name</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
<!--
<simpara>
The <parameter>var</parameter> parameter is the name of a function or method.
Also, class or object methods are specified by passing a numerical array with
two elements: the class or object, and a method name.
</simpara>
<simpara>
The optional <parameter>syntax_only</parameter> parameter will check
only for syntax and defaults to &false; The third <parameter>
callable_name</parameter> parameter is also optional.
</simpara>
<para>
In our example below note, however, that despite the implication that
<literal>a::b()</literal> is a callable static method, this is not the
case.
<example>
<title>Using <function>is_callable</function></title>
<programlisting role="php">
<![CDATA[
<?php
class a
{
var $c;
function b() {
return($this->c);
}
}
$d = new a;
if(is_callable(array($d, 'b'), FALSE, $name)) {
echo $name;
}
/* The above will print:
a::
*/
?>
]]>
</programlisting>
</example>
</para>
-->
</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
-->